📜  作为 URL 的 Action Mailer 附件 - 无论代码示例

📅  最后修改于: 2022-03-11 15:00:04.744000             🧑  作者: Mango

代码示例1
def job_apply(current_tenant, applicant)
   @current_tenant = current_tenant
   @applicant = applicant

   file = open(applicant.resume.url).read
   attachments[applicant.resume] = file

   email_with_name = "#{@current_tenant.name} <#{@current_tenant.help_email}>"
   mail(from: email_with_name, to: applicant.job.apply_email, subject: "New Job Application")
 end