sendgrid

Sendgrid API - JSON call

只谈情不闲聊 提交于 2019-12-01 10:54:54
I'm trying to receive data from SendGrid API $.ajax({ type:'GET', url:"https://sendgrid.com/api/bounces.get.json", data: {api_user:'username',api_key:'userkey',date:1}, success: function(data){ console.log(data) }, crossDomain: true, dataType: 'jsonp', error:function(a,b,c){ console.log(a); } }); Console shows : Object { readyState=4, status=200, statusText="success"} parsererror Error: jQuery17208301184673423685_1374648217666 was not called Where is the bug or issue ? The issue is that SendGrid does not support jsonp. Unfortunately, switching to plain JSON will not work either, as SendGrid

Add a newsletter subscription checkbox form on WooCommrece Register Page

断了今生、忘了曾经 提交于 2019-12-01 09:58:33
问题 I'm using SendGrid plugin which allows to create a Newsletter Subscription Form that will send email notification to subscribe to newsletter (https://sendgrid.com/docs/for-developers/sending-email/wordpress-subscription-widget/). I want that when a new user sign-up they will have an option to subscribe on newsletter through checkbox on Register Page (http://prntscr.com/nmq8h2). 回答1: The SendGrid plugin is not anymore maintained since a while (so it seems really outdated). Updated: Now to add

Can't send email through SendGrid

天大地大妈咪最大 提交于 2019-12-01 09:19:27
问题 I'm following the example from SendGrid's site and as credentials I'm pasting it what they gave me in the Azure portal. Still, I get this error message. Message = {"Failure sending mail."} InnerException = {"Unable to connect to the remote server"} I'm not clear on what to do here, not even how to debug it. I'm running the code from the desktop (before I put it on the site) so I can break-point myself through it. However, to no joy... Suggestions? Full code below. MailMessage mailMsg = new

Sendgrid API - JSON call

*爱你&永不变心* 提交于 2019-12-01 08:06:10
问题 I'm trying to receive data from SendGrid API $.ajax({ type:'GET', url:"https://sendgrid.com/api/bounces.get.json", data: {api_user:'username',api_key:'userkey',date:1}, success: function(data){ console.log(data) }, crossDomain: true, dataType: 'jsonp', error:function(a,b,c){ console.log(a); } }); Console shows : Object { readyState=4, status=200, statusText="success"} parsererror Error: jQuery17208301184673423685_1374648217666 was not called Where is the bug or issue ? 回答1: The issue is that

SendGrid incoming mail webhook - how do I secure my endpoint

夙愿已清 提交于 2019-12-01 03:33:35
I'm currently using SendGrid's Inbound Parse Webhook to feed emails to my application. I've been able to get it working by pointing the URL to an endpoint which my application has exposed. SendGrid just sends the email in the form of a JSON format HTTP POST request to this endpoint and I just process each request internally. My question is, now that I have it working, how do I ensure that only SendGrid can use this endpoint? At the moment, anyone can utilise this HTTP POST endpoint and pretend that an email has been sent to the application. Can I get SendGrid to send some sort of unique key to

How to add contact in list using (Send Grid) php api

若如初见. 提交于 2019-12-01 02:49:29
I am trying to add contact in list using php api but its throwing bellow snippet error string(51) "{"errors":[{"message":"request body is invalid"}]} " {"email":"hello@test.com","first_name":"hh","last_name":"User"} I am using bellow snippet code: $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",

How to send a csv attachment with lines longer than 990 characters?

谁说胖子不能爱 提交于 2019-12-01 02:28:56
Alright. I thought this problem had something to do with my rails app, but it seems to have to do with the deeper workings of email attachments. I have to send out a csv file from my rails app to a warehouse that fulfills orders places in my store. The warehouse has a format for the CSV, and ironically the header line of the CSV file is super long (1000+ characters). I was getting a line break in the header line of the csv file when I received the test emails and couldn't figure out what put it there. However, some googling has finally showed the reason: attached files have a line character

How to add contact in list using (Send Grid) php api

时光总嘲笑我的痴心妄想 提交于 2019-11-30 23:20:02
问题 I am trying to add contact in list using php api but its throwing bellow snippet error string(51) "{"errors":[{"message":"request body is invalid"}]} " {"email":"hello@test.com","first_name":"hh","last_name":"User"} I am using bellow snippet code: $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); //

How to dynamically set unsubscribe link in sendgrid using ruby on rails

匆匆过客 提交于 2019-11-30 23:05:49
I am using sendgrid for sending mails. There are around 20 mail templates. I have set unsubscribe template in the settings of sendgrid app "Subscription Tracking" . My requirement is different texts for unsubscribe link for different mail templates. Currently, only one static unsubscribe link as set in the sendgrid app "Subscription Tracking" is coming. Can any one help me how to dynamically set the unsubscribe link in my user_mailer class. I followed this link To give unsubscribe link in the mail using sendgrid XSMTPAPI header . But I do not know how to implement it in ruby. Below is the code

How to send a csv attachment with lines longer than 990 characters?

℡╲_俬逩灬. 提交于 2019-11-30 22:07:10
问题 Alright. I thought this problem had something to do with my rails app, but it seems to have to do with the deeper workings of email attachments. I have to send out a csv file from my rails app to a warehouse that fulfills orders places in my store. The warehouse has a format for the CSV, and ironically the header line of the CSV file is super long (1000+ characters). I was getting a line break in the header line of the csv file when I received the test emails and couldn't figure out what put