我在我的示例应用程序中集成了sendgrid电子邮件服务.并且还能够向用户发送电子邮件.
但是如何将动态数据传递给sendGrid webapp上的电子邮件模板设计? 有没有办法将动态数据发送到sendgrid设计的电子邮件模板?
对于前 我在sendgrid上设计了欢迎电子邮件模板.我想将动态数据传递给此模板,即UserName,emailId,City等..使用java代码?当任何用户在我的应用程序中注册时,我想向该用户发送欢迎电子邮件.通过我们的数据库与UserName,emailId,City等用户的信息.
该怎么办 ?怎么做 ?
通过SendGrid发送事务api.我的模板(从Mailchimp移植)有条件(例如
*|IF:SHOWTHISSECTION|*
在Mailchimp语法中).这包括或排除基于变量的模板部分.
我在SendGrid中找不到模拟,是不是没有这个功能?我想根据替换变量的存在/不存在来抑制某些部分.
以下 API 请求:
curl --request GET \
--url https://api.sendgrid.com/v3/user/profile \
--header 'Authorization: Bearer API KEY'\
--header 'Content-Type: application/json'
Run Code Online (Sandbox Code Playgroud)
来自文档:https : //sendgrid.com/docs/API_Reference/Web_API_v3/user.html
结果是带有以下正文的 HTTP 403 响应:
{"errors":[{"field":null,"message":"access forbidden"}]}
Run Code Online (Sandbox Code Playgroud)
我转到“设置”->“API 密钥”并单击“编辑详细信息”以查看授予我的 API 密钥的权限,据我所知,没有任何我可以授予(或撤销)似乎相关的权限到“用户个人资料”。
为了安全起见,如果“完全访问”不可用,我已将每个权限配置为“完全访问”(可用时)或“读取访问”,但我仍然收到此 HTTP 403 错误。
为了能够检索我的用户个人资料,我需要授予我的 API 密钥什么权限?
我正在使用NSMutableURLRequest将POST数据发送到使用SendGrid发送电子邮件的服务器端PHP脚本.这很好用.但是,我不知道如何正确打包UIImagedata作为附件发送.这是我目前的代码:
// Choose an image from your photo library
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
chosenImage = info[UIImagePickerControllerEditedImage]; // chosenImage = UIImage
pickedData = UIImagePNGRepresentation(chosenImage); // pickedData = NSData
attachment = TRUE;
[picker dismissViewControllerAnimated:YES completion:NULL];
}
-(void)sendMail {
toEmailAddress = @"blabla@blabla.com";
subject = @"Some Subject";
message = @"Some message...";
fullName = @"Mister Bla Bla";
if (attachment == TRUE) {
// Create NSData object as PNG image data from camera image
NSString *picAttachment = [NSString stringWithFormat:@"%lu",(unsigned long)[pickedData length]];
NSString *picName = …Run Code Online (Sandbox Code Playgroud) 我正在调查SendGrid并发现这个有趣的论坛帖子说你不必制作DNS模块以确保可传递性:http: //community.sendgrid.com/sendgrid/topics/why_dont_i_need_an_spf_record_or_other_dns_mods
我们的免费帐户不需要任何DNS更改,因为我们将返回路径标头,SPF和DomainKeys标头设置为指向SendGrid的SPF和DomainKeys.
我的问题是,这种方法是否可靠,客户方面的经验不会受到影响.此外,如果SendGrid自动使它们看起来可靠,那么什么阻止任何人代表我们的域发送电子邮件?
谢谢,维莱姆
我试图弄清楚如何将变量添加到已在sendgrid模板引擎中创建的现有模板(例如:动态链接或名称),我不确定如何使用SendGrid C#.NET库执行此操作.我想知道是否有人可以帮助我.
// Create the email object first, then add the properties.
SendGridMessage myMessage = new SendGridMessage();
myMessage.AddTo("test@test.com");
myMessage.From = new MailAddress("test@test.com", "Mr test");
myMessage.Subject = " ";
var timestamp = DateTime.Now.ToString("HH:mm:ss tt");
myMessage.Html = "<p></p> ";
myMessage.EnableTemplate("<p> <% body %> Hello</p>");
myMessage.EnableTemplateEngine("9386b483-8ad4-48c2-9ee3-afc7618eb56a");
var identifiers = new Dictionary<String, String>();
identifiers["USER_FULLNAME"] = "Jimbo Jones";
identifiers["VERIFICATION_URL"] = "www.google.com";
myMessage.AddUniqueArgs(identifiers);
// Create credentials, specifying your user name and password.
var credentials = new NetworkCredential("username", "password");
// Create an Web transport for sending email. …Run Code Online (Sandbox Code Playgroud) 我正在构建一个使用Sendgrid Marketing Email API的应用程序,目的是发送新闻通讯.它有许多文章链接,还有横幅广告和其他服务链接.我们显然希望继续跟踪文章链接,但排除其他链接影响点击率.是否有可能以任何方式标记我们不希望添加到跟踪的链接?
我已按照此示例将我的Angular应用程序中的数据发布到Node.js,以将webform发布到Sendgrid.这在一些变化后工作正常,并且非常感谢快速入门.将表单数据发布到Sendgrid现在正在运行!
对于这个项目我正在使用Angular Fullstack来在我的Angular应用程序中使用Node功能.
但是,此示例只包含输入字段和textarea.我希望能够添加文件(PDF,Docx等),以便人们可以通过Sendgrid向收件人发送附件.我搜索了一个解决方案,但找不到一个有效的例子.也许是因为我不想实现的目标.
我的观点(客户):
<div ng-controller="ContactFormCtrl" id="contactformbox" style="margin-top:50px;" class="mainbox" >
<div class="panel panel-info" >
<div class="panel-heading">
<div class="panel-title">Solliciteer direct</div>
</div>
<div style="padding-top:30px" class="panel-body" >
<form id="loginform" class="form-horizontal" role="form" name="contactform">
<div style="margin-bottom: 25px" class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span>
<input type="email" name="to" ng-model="email.to" ng-required="true" id="email-to" class="form-control" name="username" value="" placeholder="The emailadres from the employer">
</div>
<div style="margin-bottom: 25px" class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></span>
<input type="email" name="from" ng-model="email.from" ng-required="true" id="email-from" class="form-control" name="email-from" placeholder="Your e-mail address">
</div>
<div style="margin-bottom: 25px" …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用php api在列表中添加联系人,但它正在抛出波纹管代码片段错误
string(51)"{"errors":[{"message":"请求正文无效"}]}"{"email":"hello@test.com","first_name":"hh","last_name" :"用户"}
我使用的是以下代码段:
$url = 'https://api.sendgrid.com/v3';
$request = $url.'/contactdb/lists/12345/recipients'; //12345 is list_id
$params = array(
'email' => 'hello@test.com',
'first_name' => 'hh',
'last_name' => 'User'
);
$json_post_fields = json_encode($params);
// Generate curl request
$ch = curl_init();
$headers =
array("Content-Type: application/json",
"Authorization: Bearer SG.XXXXXXXX");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_URL, $request);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
// Apply the JSON to our curl call
curl_setopt($ch, CURLOPT_POSTFIELDS, $json_post_fields);
$data = curl_exec($ch);
if (curl_errno($ch)) {
print "Error: " . …Run Code Online (Sandbox Code Playgroud) 我在 node js 项目中使用 Send grid 发送了一封非常简单的电子邮件。但是我得到了一个 403 Forbidden 错误。API 密钥具有完全访问权限。该代码也已正确集成,因为我使用了另一个帐户的另一个 API 密钥,并且它运行良好。
有什么建议?