sendgrid

Error in SendGrid on Heroku cedar stack

六眼飞鱼酱① 提交于 2020-01-06 03:30:09
问题 when I try to send an email via sendgrid on heroku cedar stack, I got an following error : ArgumentError (SMTP-AUTH requested but missing user name): my settings in /environments/staging.rb are : config.action_mailer.delivery_method = :smtp config.action_mailer.raise_delivery_errors = true config.action_mailer.default_url_options = { :host => 'myapp' } ActionMailer::Base.smtp_settings = { :address => "smtp.sendgrid.net", :port => "587", :authentication => :plain, :user_name => ENV['SENDGRID

Is there a way to use SendGrid Template Versioning with different development life-cycle environments?

会有一股神秘感。 提交于 2020-01-05 02:55:08
问题 Versioning in SendGrid allows API clients to make template requests only by template ID documented here, however, only one version of a template can be "Active" at a time. Obviously, the template used for our production applications needs to always be set to active, but what about adding a new template version we use in an upcoming release? How can I leverage template versions to test this "Inactive" version in our test environment? The issue was discussed here, but it seems to just be closed

sendGrid set headers/content type

一曲冷凌霜 提交于 2020-01-04 17:53:35
问题 I'm looking to use sendGrid to create an outlook meeting request. I need to be able to set the content type (header) to something specific, however does anyone know how I can do this? I presume I am to use the x-smtpapi, whilst accepting a json string. Here is what I currently have. $json_string = array( 'Content-Type' => array( 'text/calendar; Content-Disposition: inline; charset=utf-8;\r\n', 'text/plain;charset=\"utf-8\"\r\n' )); Many thanks 回答1: Unfortunately, using SendGrid Web API there

Serializing JSON tersely with a max line length

落花浮王杯 提交于 2020-01-03 19:57:36
问题 So I'm generating a potentially lengthy JSON string for use in Sendgrid's SMTP API. Because it is going as an SMTP header, it should have a maximum line length (recommended 72, but absolutely no longer than 1000). One naive solution is described in the documentation at the end of: http://docs.sendgrid.com/documentation/api/smtp-api/developers-guide/ They suggest doing this: $js =~ s/(.{1,72})(\s)/$1\n /g; But I don't like that because it could split inside a string where whitespace is

how to get response of email sent using sendgrid in rails app to save in database

♀尐吖头ヾ 提交于 2020-01-03 17:06:48
问题 I have sent email through rails app using sendgrid and actionmailer, I also received the mail. But I want status of the email sent (open,deliver,bounce..) of sendgrid in my rails app so that that response of particular email i can save in my database. I have followed: https://github.com/stephenb/sendgrid for sending email and it worked for me. 回答1: To get status of sent email, use sendgrid webhooks as described here Once this is setup, sendgrid will notify your url for the following events:

sendgrid giving error sendgrid.Email is not a constructor

会有一股神秘感。 提交于 2020-01-03 10:55:15
问题 I am using sendgrid to send email. but when i try to create the email object as follow let email = new sendgrid.Email(); email.addTo("rhushikeshl@test.com"); email.setFrom("customercare@test.com"); email.setSubject("New Unit Added"); email.setHtml("New unit addded </br> Unit Id =" + savedUnit._id); sendgrid.send(email, function(err, json) { if (err) { console.log("Error: " + err); } else { console.log(json); } }); But it giving error https://sendgrid.com/docs/Integrate/Code_Examples/v2_Mail

SendGrid: How to attach a file from Azure blob storage?

可紊 提交于 2020-01-02 17:56:46
问题 I have blobs in Windows Azure blob storage that I'd like to attach to emails sent with SendGrid. I'd like to specify the file name for the attachment (real file names are just mumbo jumbo) which afaik forces me to add the attachment as a stream. My code looks like this: var msg = SendGrid.GetInstance(); // Code for adding sender, recipient etc... var storageAccount = CloudStorageAccount.Parse(ConfigurationManager.ConnectionStrings["storage"].ConnectionString); var blobClient = storageAccount

Rails 2.3.9 and SendGrid, Connection refused - connect(2) on localhost

巧了我就是萌 提交于 2020-01-02 07:04:44
问题 I've looked through Google and StackOverflow and can't figure this out. I've got a Rails 2.3.9 app using Ruby 1.8.7, trying to send email through SMTP like so: ActionMailer::Base.delivery_method = :smtp ActionMailer::Base.smtp_settings = { :address => "smtp.sendgrid.net", :port => '25', :domain => "************.com", :authentication => :plain, :user_name => "***********", :password => "**********" } My app backtrace looks like this: /Users/jared/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/net

Python Sendgrid send email with PDF attachment file

喜夏-厌秋 提交于 2020-01-02 01:54:30
问题 I'm trying to attach a PDF file to my email sent with sendgrid. Here is my code : sg = sendgrid.SendGridAPIClient(apikey=os.environ.get('SENDGRID_API_KEY')) from_email = Email("from@example.com") subject = "subject" to_email = Email("to@example.com") content = Content("text/html", email_body) pdf = open(pdf_path, "rb").read().encode("base64") attachment = Attachment() attachment.set_content(pdf) attachment.set_type("application/pdf") attachment.set_filename("test.pdf") attachment.set

How do I get an Azure SendGrid api key?

瘦欲@ 提交于 2020-01-02 01:20:32
问题 I've followed the instructions for How to Send Email Using SendGrid with Azure to set up a SendGrid account on Azure. When I use NuGet to get the SendGrid package, it's a much newer version (8.0.5 vs 6.3.4) so the sample for actually sending email is no longer valid. So, I went over to the GitHub page and looked at the Quick Start section to see how the newer api works and I'm stuck--where in the world do I find/get my SendGrid api key? It's nowhere to be found on my Azure SendGrid account