Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use a default sender name when using SendGrid?

I'm not sure where to set this up at. I'm able to send emails out with my domain ([email protected]) but I want it to be Domain [email protected] instead of Info [email protected] when users see who sent it. I am using SendGrid, Heroku, Namecheap and Ruby on Rails. How is this done?

like image 640
LearningRoR Avatar asked Mar 14 '12 23:03

LearningRoR


People also ask

How do I send an email using SendGrid?

To send emails with SendGrid, install the SendGrid SDK package by running npm i @sendgrid/mail . Then in your code, add const sgMail = require (‘@sendgrid/mail’); to import the installed package. Then in your code, you send email by: Dear user, Here is your email.

What is SendGrid’s API?

where process.env.SENDGRID_API_KEY is the SendGrid’s API, which should be stored as an environment variable since it is a secret. In this article, we will build an app that lets users enter email templates. Then they can use the templates to send emails to different email addresses. Our app will consist of a back end and a front end.

How do I add a sender identity in Twilio SendGrid email templates?

Twilio SendGrid’s pre-built email templates come with an Unsubscribe module containing your Sender information by default. For templates or emails that you build yourself, you can insert your sender identity information into your campaigns using the following tags within your campaign or template content:

What is the difference between SendGrid delete and send route?

The DELETE template route deletes by looking up the entry by ID to delete with the destroy function. The send route calls the SendGrid API to send the email with the variables declared in the email template filled in with the values set by the user.


1 Answers

A "pretty" email address can be specified using a format like

"Pretty Name" <[email protected]>

Not sure if double- or single-quotes are significant, but assuming they are, your mailer could have the lines

class MyMailer < ActionMailer::Base
   default :from => '"Pretty Name" <[email protected]>'
   ... rest of mailer code
like image 111
Tom Harrison Avatar answered Sep 20 '22 09:09

Tom Harrison