+ attachments.inline["avatar.png"] = user_avatar_file(user)
+ end
+
+ def user_avatar_file(user)
+ avatar = user&.avatar
+ if avatar&.attached?
+ return avatar.variant(:resize => "50x50>").blob.download
+ else
+ return File.read(user_avatar_file_path(user))
+ end