Is there a way to add profile pics in e-mails sent from code

Viewed 2412

So, what I am doing is I am using Sendgdrid's API (PHP API Library) to send e-mails. The sending part works, I just want to overhaul it a little to add some more customization, but I am not sure if it's possible. I am using CodeIgniter so I am skipping some code, but you get the general idea.

What I want to achieve is to customize this part

Example of what I want to modify

I want the company logo to appear there instead of the automatically generated A.

I want to achieve this:

enter image description here

Is there some header I need to modify?

My mail sending process is this (fictional data):

$email = new \SendGrid\Mail\Mail(); 
$email->setFrom("noreply@mail.com", "Sender Name");
$email->setSubject("Mail Subject");
$email->addTo($mail_data->email, $mail_data->name);
$email->addContent(
    "text/html", $this->load->view('mails/recovery', $mail_data, TRUE)
);

$sendgrid = new \SendGrid($this->config->item('sendgrid_api_key'));

try {
    $response = $sendgrid->send($email);
    // do some stuff
} catch (Exception $e) {
    // do some other stuff
}

So the mail arrives correct and everything, but is there a way to add like an avatar for the mail sender? Like the company's logo or something. Is there a way to do this via code?

I checked something about creating a google account, but what if I am using a noreply@ address and also what happens if for another mail I use a different address? I'd have to add google accounts to each one?

0 Answers
Related