Skip to main content
INFYNNO
INFYNNO
Infinite InnovationsInfinite Innovations
  1. Home
  2. Articles
  3. How To Send Mail Using Sendgrid Dynamic Templates

How To Send Mail Using Sendgrid Dynamic Templates

Sendgrid is very popular API to send email from our laravel application. It is very fast to send mail and also you can track sended mail. Tracking email is very important feature of Sendgrid api

B

Bhavdip

Author · Infynno Solutions

May 14, 20212 sections
Laravel

At a glance

CategorySendgrid
Sections2 topics
AuthorBhavdip
PublishedMay 14, 2021
Start reading
How To Send Mail Using Sendgrid Dynamic Templates

Before we begin

In order to complete this tutorial, you will need the following:

  • Composer installed and ready to use
  • Basic knowledge of the Laravel framework
  • A locally-installed database server ready to use
  • A SendGrid account

 

Want us to build this for you?

Infynno builds AI-powered software for EdTech, enterprise, and SaaS teams. Free discovery call · NDA first.

Book Free Discovery Call

Why Twilio SendGrid’s Email API?

Sendgrid is very popular API to send email from our laravel application. It is very fast to send mail and also you can track sended mail. Tracking email is very important feature of Sendgrid api and you can also see how much user open your mail, click on your mail too. In this post i would like to show you how to setting of Sendgrid in our laravel 8 application. In this example you can learn to send simple mail using Sendgrid site. If you are use Sendgrid for sending email then you can save loading time and you can get mail fast.

First we will add configration on mail. i added my gmail account configration. so first open .env file and bellow code:

.env

env.png

Set up SendGrid

Next, we need to install the SendGrid SDK for Laravel using the command below.

sendgrid.png

After installing the SDK, head over to the SendGrid Dashboard. Then, click “Settings -> API Keys”. On the API Keys page, click “Create API Key’‘ in” in the upper right-hand corner. Enter a name for your new API key, leave “API Key Permissions” set to “Full Access“, and click “Create & View” in the lower right-hand corner to create the key.

Create API Key

sendgrid_apiKey_1.png

After doing so a new API key will be created. Copy your API key, which is required for the SDK to send emails.

sendgrid_apikey.png

Note: make sure you’ve copied it, as once you click “Done”, for security reasons, you won’t be able to view it again.

Then, in .env add the configuration below, replacing {YOUR API KEY} with the SendGrid API key which you just copied.

env_update.png

Create Dynamic Templates

In order to use the email from API and populating dynamic values, you should understand the handlebars and how they can be used.

https://sendgrid.com/docs/ui/sending-email/how-to-send-an-email-with-dynamic-transactional-templates/#design-a-dynamic-transactional-template

To create a dynamic template follow the below steps

https://mc.sendgrid.com/dynamic-templates

  • Create a dynamic template
  • Note the template ID d-6f21228d64f74495ae34d91b5a6a176d
B

Bhavdip

Author · Infynno Solutions

May 14, 2021

Share

XLinkedIn

On this page

Before we beginWhy Twilio SendGrid’s Email API?

Building something like this?

Free discovery call. NDA before we go further.

Book a free call
B

Bhavdip

Author

Engineer at Infynno Solutions building AI, EdTech & enterprise software products.

More from the blog

All articles
Laracon India 2026: The Ultimate Guide for Laravel Developers and Founders
EventsJan 25, 2026

Laracon India 2026: The Ultimate Guide for Laravel Developers and Founders

Laracon India 2026 is not just another Laravel conference. It is becoming a turning point for the Laravel ecosystem in India and beyond.

Bhavdip
Effective Next.js Optimization Strategies to Improve App Performance
DevelopmentSep 5, 2024

Effective Next.js Optimization Strategies to Improve App Performance

When you’re working on a Next.js app, you’ve probably had those moments where you’re like, ‘Why is the app moving so slowly?’ Recently, I received a project where the performance of a Next.js app was not up to the mark. So, as a team, we discussed and identified some effective Next.js optimization strategies and use cases where the app needs the most improvement.

Bhavdip
Custom Software Solutions for Educational Platforms by Infynno
LMSAug 27, 2024

Custom Software Solutions for Educational Platforms by Infynno

In today’s world, technology is playing a huge role in education. Whether it’s UCAT preparation or other educational purposes, having the right tech platform makes a big difference. At Infynno Solutions, we focus on creating custom software solutions for educational platforms. We’re all about helping educational institutes, especially when it comes to building and scaling platforms that really work.

Bhavdip
Infynno

Infynno is an AI-native product engineering company helping businesses build, modernize, and scale software products through AI, automation, and experienced engineering teams.

Trusted worldwide

Google
Google
4.9
22 reviews
Clutch
Clutch
4.9
8+ reviews
Upwork
Upwork
Top Rated
8K+ Hours, 20+ Jobs
Glassdoor
Glassdoor
5
18 reviews

Trusted worldwide

Google
Google
4.9
22 reviews
Clutch
Clutch
4.9
8+ reviews
Upwork
Upwork
Top Rated
8K+ Hours, 20+ Jobs
Glassdoor
Glassdoor
5
18 reviews

Engineering Services

  • AI Strategy & Consulting
  • AI Integration
  • AI Automation & AI Agents
  • IT Consulting
  • Web Development
  • Product Development
  • AI Search Visibility (AEO + GEO)
  • Social Media and Branding

Edtech Industry Expertise

  • Learning Management Software
  • Exam Preparation Platform
  • Tutor Management Software
  • Medical Entrance Exam Platform
  • Scholarship Exam Platform
  • AI For Education
  • EdTech Mobile App Development

Company

  • About Infynno
  • Our Work
  • Client Success Stories
  • Life @ Infynno
  • Contact Us

Resources

  • Case Studies
  • Guides
  • Blogs
  • FAQs
  • Open Source & Community
  • Careers

Contact

  • Project Inquiry

    sales@infynno.com
  • HR & Careers

    hr@infynno.com
  • Phone

    +91-84888-38308

Office address

India

Ahmedabad, India

E-720 Ganesh Glory 11,

Nr. BSNL Office, Jagatpur Road,

Gota, S.G. Highway,

Ahmedabad - 382481, Gujarat

IST · UTC+5:30

Trusted worldwide

Google
Google
4.9
22 reviews
Clutch
Clutch
4.9
8+ reviews
Upwork
Upwork
Top Rated
8K+ Hours, 20+ Jobs
Glassdoor
Glassdoor
5
18 reviews
ISO 27001:2022 certified company

An ISO 27001:2022 Certified Company

  • LLP Identification Number - AAZ-7794

© 2026 Infynno Solutions LLP. All rights reserved.

Privacy PolicyTerms of UseCookie PolicySitemap
Infinite Innovations