简体   繁体   English

Sendgrid 在发送的同时生成个性化内容

[英]Sendgrid generate personalized content while sending

I need to send an email to my user list in Sendgrid.我需要向 Sendgrid 中的用户列表发送电子邮件。 The emails should include a personalised link to my website.电子邮件应包含指向我网站的个性化链接。 These links can't be pre-generated.这些链接无法预先生成。

Can Sendgrid call a Cloud Function, or make an API call to generate the personalised links? Sendgrid 可以调用 Cloud Functions 或调用 API 来生成个性化链接吗?

I am missing some context to understand exactly what you're trying to do.我缺少一些上下文来准确理解你想要做什么。 It sounds like you are using SendGrid Contact Lists /Segments, and you want to use a single send to email them.听起来您正在使用SendGrid 联系人列表/细分,并且您想使用单个发送来向他们发送电子邮件。 Is that accurate?那是准确的吗?

Using Single Sends, you can use handlebars templating to generate your emails, however, handlebars does not let you make HTTP requests or call Cloud Functions.使用 Single Sends,您可以使用handlebars 模板生成电子邮件,但是,handlebars 不允许您发出 HTTP 请求或调用 Cloud Functions。 You can pull data from the SendGrid Contact, so if you need to have a personalized link to your website, that URL will need to be composed of data in the SendGrid Contact.您可以从 SendGrid Contact 中提取数据,因此如果您需要一个指向您网站的个性化链接,该 URL 将需要由 SendGrid Contact 中的数据组成。

If the data you need in the URL is not stored in the Contact yet, you can update the contact and store the data in a custom field , then pull the data from the contact in your Handlebars template.如果您在 URL 中需要的数据尚未存储在联系人中,您可以更新联系人并将数据存储在自定义字段中,然后从 Handlebars 模板中的联系人中提取数据。


If you aren't using SendGrid Contacts, but instead, you're pulling your contacts from somewhere using node.js, then you can use personalization with either Substitution Tags or Dynamic Email Templates in the SendGrid node.js library.如果您没有使用 SendGrid 联系人,而是使用 node.js 从某处提取联系人,那么您可以使用 SendGrid node.js 库中的替换标签动态电子邮件模板进行个性化设置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM