标签: sendgrid-ruby

如何使用 Sendgrid 和 Rails 禁用某些链接的链接跟踪

当通过 sendgrid 从 Rails 发送电子邮件时,有什么方法可以禁用某些链接的链接跟踪吗?

sendgrid sendgrid-ruby

4
推荐指数
1
解决办法
1891
查看次数

特殊字符的编码不适用于 sendgrid 模板的电子邮件主题

我一直在使用 sendgrid-ruby gem 发送电子邮件。电子邮件的主题没有正确解码特殊字符。例如。为电子邮件发送此主题会How's it going在实际电子邮件中转换为此主题How's it going

我曾尝试将字符串编码为不同的格式,例如 ASCII、ISO_8859_1,但这些都不起作用。

@body_json['personalizations'][0]['dynamic_template_data'] = {
    'email_title': @email_title,
    'content': @description,
    'subject': "How's it going"
}

SendGrid::API.new(api_key: ENV['SENDGRID_API_KEY']).client.mail._('send').post(request_body: @body_json)
Run Code Online (Sandbox Code Playgroud)

电子邮件主题应正确显示特殊字符,例如 ' & :

ruby-on-rails sendgrid sendgrid-ruby sendgrid-templates

2
推荐指数
1
解决办法
2858
查看次数