You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't quite get how to attach files to an email, I checked the API and it says it should be under the content.attachments section as an array, yet doing this doesn't seem to work, this is how I'm sending my email:
def buyer_tickets_email(order)
@order = order
data = {
substitution_data: purchase_order_details(@order),
content: {
attachments: order.tickets.map do |ticket|
{
name: "#{ticket_file_name(ticket)}.pdf",
type: "application/pdf",
data: ticket.to_pdf
}
end
},
template_id: 'buyer-tickets-email'
}
mail to: @order.email, subject: I18n.t('tickets_mailer.subject'), sparkpost_data: data
end
Am I missing something? The email arrives correctly yet without the attached pdfs
The text was updated successfully, but these errors were encountered:
I don't quite get how to attach files to an email, I checked the API and it says it should be under the
content.attachments
section as an array, yet doing this doesn't seem to work, this is how I'm sending my email:Am I missing something? The email arrives correctly yet without the attached pdfs
The text was updated successfully, but these errors were encountered: