How to create custom email headers

前端 未结 4 631
南笙
南笙 2021-02-02 10:03

I\'m trying to create a custom email header to use the SendGrid api.

Here\'s what I\'m doing - but its not working:

class Mailman < ActionMailer::Ba         


        
4条回答
  •  礼貌的吻别
    2021-02-02 10:35

    I am using below code and works fine, just convert the hash to json with to_json

    headers['X-SMTPAPI'] = { 
      category: "Weekly Newsletter",
      unique_args: { user_id: user.id } 
    }.to_json
    

提交回复
热议问题