SlideShare a Scribd company logo
Sending Emails with SendGrid and
Laravel
Sayed Ahmed
Computer Engineering, BUET, Bangladesh (2001)
MSc. Computer Science, U of Manitoba, Canada
Exploring Computing from 1996
Requirements
 A SendGrid Account
◦ Cloud based email delivery services
◦ http://sendgrid.com/
 Beanstalkd
◦ Email queue
◦ http://kr.github.io/beanstalkd/
 Laravel go mail worker
◦ Laravel Mail sender using Sendgrid [as an example]
◦ https://github.com/zackkitzmiller/laravel-go-mail-
worker
◦ https://github.com/zackkitzmiller/laravel-go-mail-
worker/blob/master/laravel-go-mail-
worker/app/commands/QueueEmailCommand.php
◦ https://github.com/zackkitzmiller/laravel-go-mail-
worker/blob/master/go/src/zackkitzmiller/laravel-go-mail-worker/main.go
Must Watch
 Mail Queue configuration for Laravel
◦ https://github.com/laravel/laravel/blob/mas
ter/app/config/queue.php
 Basic Mail Configuration for Laravel
[Not a Must]
◦ https://github.com/laravel/laravel/blob/mas
ter/app/config/mail.php
How These All Will Work
 You need to queue the message in Beanstalkd
◦ You need to configure Laravel and Laravel Go Mailer for
that
◦ From your code, you need to use methods to queue the
message
 $message = "This is a queue test job. We won't really need to pass
data for this demo.";
 Queue::push('QueueDemo', array('message' => $message));
◦ This apparently looks like will also work
 Mail::queueOn('queue-name', 'emails.welcome', $data,
function($message) { $message
 ->to('foo@example.com', 'John Smith')
 ->subject('Welcome!'); });
◦ Then the GO application will send this email
 It’s Laravel go mail worker
◦ Then Go mailer will use SendGrid to send the mail
How These All Will Work
 Configuration for Go mail worker
◦ BEANSTALKD: location of the beanstalk
installation (e.g. localhost:11300)
◦ SENDGRID_USER: username for
sendgrid account
◦ SENDGRID_PASS: password for
sendgrid account
Installation
 Install Go Mailer
◦ Artisan command email:send. Will do that
for you
 Not sure yet that it will work; after working with
it, I will update
◦ Though you can get the copy of the
Laravel-go-mailer and use that for sure
Miscellaneous
 How to Download and Install Beanstalkd
◦ http://kr.github.io/beanstalkd/download.html
◦ Src: git clone git://github.com/kr/beanstalkd.git
◦ Install:
 Mac: sudo port install beanstalkd
 Debian: sudo apt-get install beanstalkd
 Ubuntu: sudo apt-get install beanstalkd
 Fedora: su -c 'yum install beanstalkd'
 Sending emails from Laravel using Mail
Servers such as SwiftMailer
◦ http://laravel.com/docs/mail
 Mail Queue tutorial for Laravel
◦ http://vimeo.com/64779946
Miscellaneous
 Beanstalkd listed as the default in
Laravel-go-mailer queue config file
◦ https://github.com/zackkitzmiller/laravel-
go-mail-worker/blob/master/laravel-go-
mail-worker/app/config/queue.php
 These are the environment variables
◦ Set SENDGRID_USER,
SENDGRID_PASS, and BEANSTALKD
env vars
◦ Can be set in Linux profile type files
 Also from within PHP you can set
Environment Variables and
PHP
 echo 'My username is ' .$_ENV["USER"] . '!'
;
 // Example use of getenv()
$ip = getenv('REMOTE_ADDR');
 putenv("UNIQID=$uniqid");

Beanstalkd Configuration File
Content
 You can know but you will not need to work with
it much for basic functionality
◦ [program:qlistener]
◦ command=php /var/www/laravel/artisan queue:listen
process_name=%(program_name)s
◦ numprocs=1
◦ numprocs_start=0
◦ autostart=true
◦ autorestart=true
◦ startsecs=1
◦ startretries=3
◦ exitcodes=0,2
◦ stopsignal=TERM
◦ stopwaitsecs=10
Beanstalkd Configuration File
Content
◦ user=ubuntu
◦ redirect_stderr=false
◦ stdout_logfile=/var/log/supervisor/qlistener-stdout.log
◦ stdout_logfile_maxbytes=50MB
◦ stdout_logfile_backups=10
◦ stdout_capture_maxbytes=0
◦ stdout_events_enabled=false
◦ stderr_logfile=/var/log/supervisor/qlistener-stderr.log
◦ stderr_logfile_maxbytes=50MB
◦ stderr_logfile_backups=10
◦ stderr_capture_maxbytes=0
◦ tderr_events_enabled=false
environment=LARAVEL_ENV="production"
◦ serverurl=AUTO
Reference
 http://b.z19r.com/post/sending-email-
with-laravel-sendgrid-beanstalkd-and-
go

More Related Content

What's hot

SVCC Google App Engine: Java Runtime
SVCC Google App Engine: Java RuntimeSVCC Google App Engine: Java Runtime
SVCC Google App Engine: Java Runtime
Van Riper
 
Intro to the Express Web Framework
Intro to the Express Web FrameworkIntro to the Express Web Framework
Intro to the Express Web Framework
jasonsich
 
Understanding meteor
Understanding meteorUnderstanding meteor
Understanding meteor
M A Hossain Tonu
 
Type script for_java_dev_jul_2020
Type script for_java_dev_jul_2020Type script for_java_dev_jul_2020
Type script for_java_dev_jul_2020
Yakov Fain
 
Angular 2 Migration - JHipster Meetup 6
Angular 2 Migration - JHipster Meetup 6Angular 2 Migration - JHipster Meetup 6
Angular 2 Migration - JHipster Meetup 6
William Marques
 
Mangling
Mangling Mangling
Mangling
Olaf Alders
 
The MetaCPAN VM Part II (Using the VM)
The MetaCPAN VM Part II (Using the VM)The MetaCPAN VM Part II (Using the VM)
The MetaCPAN VM Part II (Using the VM)
Olaf Alders
 
Test Automation using Ruby
Test Automation using Ruby Test Automation using Ruby
Test Automation using Ruby
Sla Va
 
Angular2RoutingSetupByShubham
Angular2RoutingSetupByShubhamAngular2RoutingSetupByShubham
Angular2RoutingSetupByShubham
Shubham Verma
 
Puppet At Twitter - Puppet Camp Silicon Valley
Puppet At Twitter - Puppet Camp Silicon ValleyPuppet At Twitter - Puppet Camp Silicon Valley
Puppet At Twitter - Puppet Camp Silicon Valley
Puppet
 
Lazy angular w/ webpack
Lazy angular w/ webpackLazy angular w/ webpack
Lazy angular w/ webpack
Rich Snapp
 
Initialize database in Mule part2
Initialize database in Mule part2Initialize database in Mule part2
Initialize database in Mule part2
Anirban Sen Chowdhary
 
Where is my scalable api?
Where is my scalable api?Where is my scalable api?
Where is my scalable api?
Altoros
 
SocketIOSetupWithAngularJSAppByShubham
SocketIOSetupWithAngularJSAppByShubhamSocketIOSetupWithAngularJSAppByShubham
SocketIOSetupWithAngularJSAppByShubham
Shubham Verma
 
Testing MeteorJS using CasperJS
Testing MeteorJS using CasperJSTesting MeteorJS using CasperJS
Testing MeteorJS using CasperJS
Stephan Hochhaus
 
Up & running with jasmine
Up & running with jasmineUp & running with jasmine
Up & running with jasmine
kamarul kawnayeen
 
Virtual server on aws
Virtual server on awsVirtual server on aws
Virtual server on aws
kamarul kawnayeen
 
Micrometerでメトリクスを収集してAmazon CloudWatchで可視化
Micrometerでメトリクスを収集してAmazon CloudWatchで可視化Micrometerでメトリクスを収集してAmazon CloudWatchで可視化
Micrometerでメトリクスを収集してAmazon CloudWatchで可視化
Ryosuke Uchitate
 
Django rest framework
Django rest frameworkDjango rest framework
Django rest framework
Blank Chen
 
Service Configuration Management for Rapid Growth - demo 10 steps to build pi...
Service Configuration Management for Rapid Growth - demo 10 steps to build pi...Service Configuration Management for Rapid Growth - demo 10 steps to build pi...
Service Configuration Management for Rapid Growth - demo 10 steps to build pi...
Takashi Someda
 

What's hot (20)

SVCC Google App Engine: Java Runtime
SVCC Google App Engine: Java RuntimeSVCC Google App Engine: Java Runtime
SVCC Google App Engine: Java Runtime
 
Intro to the Express Web Framework
Intro to the Express Web FrameworkIntro to the Express Web Framework
Intro to the Express Web Framework
 
Understanding meteor
Understanding meteorUnderstanding meteor
Understanding meteor
 
Type script for_java_dev_jul_2020
Type script for_java_dev_jul_2020Type script for_java_dev_jul_2020
Type script for_java_dev_jul_2020
 
Angular 2 Migration - JHipster Meetup 6
Angular 2 Migration - JHipster Meetup 6Angular 2 Migration - JHipster Meetup 6
Angular 2 Migration - JHipster Meetup 6
 
Mangling
Mangling Mangling
Mangling
 
The MetaCPAN VM Part II (Using the VM)
The MetaCPAN VM Part II (Using the VM)The MetaCPAN VM Part II (Using the VM)
The MetaCPAN VM Part II (Using the VM)
 
Test Automation using Ruby
Test Automation using Ruby Test Automation using Ruby
Test Automation using Ruby
 
Angular2RoutingSetupByShubham
Angular2RoutingSetupByShubhamAngular2RoutingSetupByShubham
Angular2RoutingSetupByShubham
 
Puppet At Twitter - Puppet Camp Silicon Valley
Puppet At Twitter - Puppet Camp Silicon ValleyPuppet At Twitter - Puppet Camp Silicon Valley
Puppet At Twitter - Puppet Camp Silicon Valley
 
Lazy angular w/ webpack
Lazy angular w/ webpackLazy angular w/ webpack
Lazy angular w/ webpack
 
Initialize database in Mule part2
Initialize database in Mule part2Initialize database in Mule part2
Initialize database in Mule part2
 
Where is my scalable api?
Where is my scalable api?Where is my scalable api?
Where is my scalable api?
 
SocketIOSetupWithAngularJSAppByShubham
SocketIOSetupWithAngularJSAppByShubhamSocketIOSetupWithAngularJSAppByShubham
SocketIOSetupWithAngularJSAppByShubham
 
Testing MeteorJS using CasperJS
Testing MeteorJS using CasperJSTesting MeteorJS using CasperJS
Testing MeteorJS using CasperJS
 
Up & running with jasmine
Up & running with jasmineUp & running with jasmine
Up & running with jasmine
 
Virtual server on aws
Virtual server on awsVirtual server on aws
Virtual server on aws
 
Micrometerでメトリクスを収集してAmazon CloudWatchで可視化
Micrometerでメトリクスを収集してAmazon CloudWatchで可視化Micrometerでメトリクスを収集してAmazon CloudWatchで可視化
Micrometerでメトリクスを収集してAmazon CloudWatchで可視化
 
Django rest framework
Django rest frameworkDjango rest framework
Django rest framework
 
Service Configuration Management for Rapid Growth - demo 10 steps to build pi...
Service Configuration Management for Rapid Growth - demo 10 steps to build pi...Service Configuration Management for Rapid Growth - demo 10 steps to build pi...
Service Configuration Management for Rapid Growth - demo 10 steps to build pi...
 

Viewers also liked

MySQLi - An Improved Extension of MySQL
MySQLi - An Improved Extension of MySQLMySQLi - An Improved Extension of MySQL
MySQLi - An Improved Extension of MySQL
Global Codester
 
MySQLi
MySQLiMySQLi
Queue Data Structure (w/ php egs)
Queue Data Structure (w/ php egs)Queue Data Structure (w/ php egs)
Queue Data Structure (w/ php egs)
Roman Rodomansky
 
Queue Data Structure
Queue Data StructureQueue Data Structure
Queue Data Structure
Zidny Nafan
 
Queue data structure
Queue data structureQueue data structure
Queue data structure
anooppjoseph
 
STACKS IN DATASTRUCTURE
STACKS IN DATASTRUCTURESTACKS IN DATASTRUCTURE
STACKS IN DATASTRUCTURE
Archie Jamwal
 

Viewers also liked (6)

MySQLi - An Improved Extension of MySQL
MySQLi - An Improved Extension of MySQLMySQLi - An Improved Extension of MySQL
MySQLi - An Improved Extension of MySQL
 
MySQLi
MySQLiMySQLi
MySQLi
 
Queue Data Structure (w/ php egs)
Queue Data Structure (w/ php egs)Queue Data Structure (w/ php egs)
Queue Data Structure (w/ php egs)
 
Queue Data Structure
Queue Data StructureQueue Data Structure
Queue Data Structure
 
Queue data structure
Queue data structureQueue data structure
Queue data structure
 
STACKS IN DATASTRUCTURE
STACKS IN DATASTRUCTURESTACKS IN DATASTRUCTURE
STACKS IN DATASTRUCTURE
 

Similar to Sending email with send grid and laravel

Control your deployments with Capistrano
Control your deployments with CapistranoControl your deployments with Capistrano
Control your deployments with Capistrano
Ramazan K
 
Apache Wizardry - Ohio Linux 2011
Apache Wizardry - Ohio Linux 2011Apache Wizardry - Ohio Linux 2011
Apache Wizardry - Ohio Linux 2011
Rich Bowen
 
Capistrano Overview
Capistrano OverviewCapistrano Overview
Capistrano Overview
Travis Roberts
 
Container orchestration from theory to practice
Container orchestration from theory to practiceContainer orchestration from theory to practice
Container orchestration from theory to practice
Docker, Inc.
 
Integrating Apache Web Server with Tomcat Application Server
Integrating Apache Web Server with Tomcat Application ServerIntegrating Apache Web Server with Tomcat Application Server
Integrating Apache Web Server with Tomcat Application Server
webhostingguy
 
Integrating Apache Web Server with Tomcat Application Server
Integrating Apache Web Server with Tomcat Application ServerIntegrating Apache Web Server with Tomcat Application Server
Integrating Apache Web Server with Tomcat Application Server
webhostingguy
 
Apache Cookbook - TekX Chicago 2010
Apache Cookbook - TekX Chicago 2010Apache Cookbook - TekX Chicago 2010
Apache Cookbook - TekX Chicago 2010
Rich Bowen
 
Deploy Rails Application by Capistrano
Deploy Rails Application by CapistranoDeploy Rails Application by Capistrano
Deploy Rails Application by Capistrano
Tasawr Interactive
 
Making Spinnaker Go @ Stitch Fix
Making Spinnaker Go @ Stitch FixMaking Spinnaker Go @ Stitch Fix
Making Spinnaker Go @ Stitch Fix
Diana Tkachenko
 
Monkeybars in the Manor
Monkeybars in the ManorMonkeybars in the Manor
Monkeybars in the Manor
martinbtt
 
Dockerizing WordPress
Dockerizing WordPressDockerizing WordPress
Dockerizing WordPress
dotCloud
 
CukeUp! 2012: Michael Nacos on Just enough infrastructure for product develop...
CukeUp! 2012: Michael Nacos on Just enough infrastructure for product develop...CukeUp! 2012: Michael Nacos on Just enough infrastructure for product develop...
CukeUp! 2012: Michael Nacos on Just enough infrastructure for product develop...
Skills Matter Talks
 
Dockerizing WordPress
Dockerizing WordPressDockerizing WordPress
Dockerizing WordPress
Docker, Inc.
 
Os dev tool box
Os dev tool boxOs dev tool box
Os dev tool box
bpowell29a
 
"To cover uncoverable", Andrii Shumada
"To cover uncoverable", Andrii Shumada"To cover uncoverable", Andrii Shumada
"To cover uncoverable", Andrii Shumada
Fwdays
 
АНДРІЙ ШУМАДА «To Cover Uncoverable» Online WDDay 2022 js
АНДРІЙ ШУМАДА «To Cover Uncoverable» Online WDDay 2022 jsАНДРІЙ ШУМАДА «To Cover Uncoverable» Online WDDay 2022 js
АНДРІЙ ШУМАДА «To Cover Uncoverable» Online WDDay 2022 js
WDDay
 
Apache Web Services
Apache Web ServicesApache Web Services
Apache Web Services
lkurriger
 
Jedi Mind Tricks for Git
Jedi Mind Tricks for GitJedi Mind Tricks for Git
Jedi Mind Tricks for Git
Jan Krag
 
Dockerizing the Hard Services: Neutron and Nova
Dockerizing the Hard Services: Neutron and NovaDockerizing the Hard Services: Neutron and Nova
Dockerizing the Hard Services: Neutron and Nova
clayton_oneill
 
20130528 solution linux_frousseau_nopain_webdev
20130528 solution linux_frousseau_nopain_webdev20130528 solution linux_frousseau_nopain_webdev
20130528 solution linux_frousseau_nopain_webdev
Frank Rousseau
 

Similar to Sending email with send grid and laravel (20)

Control your deployments with Capistrano
Control your deployments with CapistranoControl your deployments with Capistrano
Control your deployments with Capistrano
 
Apache Wizardry - Ohio Linux 2011
Apache Wizardry - Ohio Linux 2011Apache Wizardry - Ohio Linux 2011
Apache Wizardry - Ohio Linux 2011
 
Capistrano Overview
Capistrano OverviewCapistrano Overview
Capistrano Overview
 
Container orchestration from theory to practice
Container orchestration from theory to practiceContainer orchestration from theory to practice
Container orchestration from theory to practice
 
Integrating Apache Web Server with Tomcat Application Server
Integrating Apache Web Server with Tomcat Application ServerIntegrating Apache Web Server with Tomcat Application Server
Integrating Apache Web Server with Tomcat Application Server
 
Integrating Apache Web Server with Tomcat Application Server
Integrating Apache Web Server with Tomcat Application ServerIntegrating Apache Web Server with Tomcat Application Server
Integrating Apache Web Server with Tomcat Application Server
 
Apache Cookbook - TekX Chicago 2010
Apache Cookbook - TekX Chicago 2010Apache Cookbook - TekX Chicago 2010
Apache Cookbook - TekX Chicago 2010
 
Deploy Rails Application by Capistrano
Deploy Rails Application by CapistranoDeploy Rails Application by Capistrano
Deploy Rails Application by Capistrano
 
Making Spinnaker Go @ Stitch Fix
Making Spinnaker Go @ Stitch FixMaking Spinnaker Go @ Stitch Fix
Making Spinnaker Go @ Stitch Fix
 
Monkeybars in the Manor
Monkeybars in the ManorMonkeybars in the Manor
Monkeybars in the Manor
 
Dockerizing WordPress
Dockerizing WordPressDockerizing WordPress
Dockerizing WordPress
 
CukeUp! 2012: Michael Nacos on Just enough infrastructure for product develop...
CukeUp! 2012: Michael Nacos on Just enough infrastructure for product develop...CukeUp! 2012: Michael Nacos on Just enough infrastructure for product develop...
CukeUp! 2012: Michael Nacos on Just enough infrastructure for product develop...
 
Dockerizing WordPress
Dockerizing WordPressDockerizing WordPress
Dockerizing WordPress
 
Os dev tool box
Os dev tool boxOs dev tool box
Os dev tool box
 
"To cover uncoverable", Andrii Shumada
"To cover uncoverable", Andrii Shumada"To cover uncoverable", Andrii Shumada
"To cover uncoverable", Andrii Shumada
 
АНДРІЙ ШУМАДА «To Cover Uncoverable» Online WDDay 2022 js
АНДРІЙ ШУМАДА «To Cover Uncoverable» Online WDDay 2022 jsАНДРІЙ ШУМАДА «To Cover Uncoverable» Online WDDay 2022 js
АНДРІЙ ШУМАДА «To Cover Uncoverable» Online WDDay 2022 js
 
Apache Web Services
Apache Web ServicesApache Web Services
Apache Web Services
 
Jedi Mind Tricks for Git
Jedi Mind Tricks for GitJedi Mind Tricks for Git
Jedi Mind Tricks for Git
 
Dockerizing the Hard Services: Neutron and Nova
Dockerizing the Hard Services: Neutron and NovaDockerizing the Hard Services: Neutron and Nova
Dockerizing the Hard Services: Neutron and Nova
 
20130528 solution linux_frousseau_nopain_webdev
20130528 solution linux_frousseau_nopain_webdev20130528 solution linux_frousseau_nopain_webdev
20130528 solution linux_frousseau_nopain_webdev
 

More from Sayed Ahmed

Workplace, Data Analytics, and Ethics
Workplace, Data Analytics, and EthicsWorkplace, Data Analytics, and Ethics
Workplace, Data Analytics, and Ethics
Sayed Ahmed
 
Python py charm anaconda jupyter installation and basic commands
Python py charm anaconda jupyter   installation and basic commandsPython py charm anaconda jupyter   installation and basic commands
Python py charm anaconda jupyter installation and basic commands
Sayed Ahmed
 
[not edited] Demo on mobile app development using ionic framework
[not edited] Demo on mobile app development using ionic framework[not edited] Demo on mobile app development using ionic framework
[not edited] Demo on mobile app development using ionic framework
Sayed Ahmed
 
Sap hana-ide-overview-nodev
Sap hana-ide-overview-nodevSap hana-ide-overview-nodev
Sap hana-ide-overview-nodev
Sayed Ahmed
 
Invest wisely
Invest wiselyInvest wisely
Invest wisely
Sayed Ahmed
 
Will be an introduction to
Will be an introduction toWill be an introduction to
Will be an introduction to
Sayed Ahmed
 
Whm and cpanel overview hosting control panel overview
Whm and cpanel overview   hosting control panel overviewWhm and cpanel overview   hosting control panel overview
Whm and cpanel overview hosting control panel overview
Sayed Ahmed
 
Web application development using zend framework
Web application development using zend frameworkWeb application development using zend framework
Web application development using zend framework
Sayed Ahmed
 
Web design and_html_part_3
Web design and_html_part_3Web design and_html_part_3
Web design and_html_part_3
Sayed Ahmed
 
Web design and_html_part_2
Web design and_html_part_2Web design and_html_part_2
Web design and_html_part_2
Sayed Ahmed
 
Web design and_html
Web design and_htmlWeb design and_html
Web design and_html
Sayed Ahmed
 
Visual studio ide shortcuts
Visual studio ide shortcutsVisual studio ide shortcuts
Visual studio ide shortcuts
Sayed Ahmed
 
Virtualization
VirtualizationVirtualization
Virtualization
Sayed Ahmed
 
User interfaces
User interfacesUser interfaces
User interfaces
Sayed Ahmed
 
Unreal
UnrealUnreal
Unreal
Sayed Ahmed
 
Unit tests in_symfony
Unit tests in_symfonyUnit tests in_symfony
Unit tests in_symfony
Sayed Ahmed
 
Telerik this is sayed
Telerik this is sayedTelerik this is sayed
Telerik this is sayed
Sayed Ahmed
 
System analysis and_design
System analysis and_designSystem analysis and_design
System analysis and_design
Sayed Ahmed
 
Symfony 2
Symfony 2Symfony 2
Symfony 2
Sayed Ahmed
 
Story telling and_narrative
Story telling and_narrativeStory telling and_narrative
Story telling and_narrative
Sayed Ahmed
 

More from Sayed Ahmed (20)

Workplace, Data Analytics, and Ethics
Workplace, Data Analytics, and EthicsWorkplace, Data Analytics, and Ethics
Workplace, Data Analytics, and Ethics
 
Python py charm anaconda jupyter installation and basic commands
Python py charm anaconda jupyter   installation and basic commandsPython py charm anaconda jupyter   installation and basic commands
Python py charm anaconda jupyter installation and basic commands
 
[not edited] Demo on mobile app development using ionic framework
[not edited] Demo on mobile app development using ionic framework[not edited] Demo on mobile app development using ionic framework
[not edited] Demo on mobile app development using ionic framework
 
Sap hana-ide-overview-nodev
Sap hana-ide-overview-nodevSap hana-ide-overview-nodev
Sap hana-ide-overview-nodev
 
Invest wisely
Invest wiselyInvest wisely
Invest wisely
 
Will be an introduction to
Will be an introduction toWill be an introduction to
Will be an introduction to
 
Whm and cpanel overview hosting control panel overview
Whm and cpanel overview   hosting control panel overviewWhm and cpanel overview   hosting control panel overview
Whm and cpanel overview hosting control panel overview
 
Web application development using zend framework
Web application development using zend frameworkWeb application development using zend framework
Web application development using zend framework
 
Web design and_html_part_3
Web design and_html_part_3Web design and_html_part_3
Web design and_html_part_3
 
Web design and_html_part_2
Web design and_html_part_2Web design and_html_part_2
Web design and_html_part_2
 
Web design and_html
Web design and_htmlWeb design and_html
Web design and_html
 
Visual studio ide shortcuts
Visual studio ide shortcutsVisual studio ide shortcuts
Visual studio ide shortcuts
 
Virtualization
VirtualizationVirtualization
Virtualization
 
User interfaces
User interfacesUser interfaces
User interfaces
 
Unreal
UnrealUnreal
Unreal
 
Unit tests in_symfony
Unit tests in_symfonyUnit tests in_symfony
Unit tests in_symfony
 
Telerik this is sayed
Telerik this is sayedTelerik this is sayed
Telerik this is sayed
 
System analysis and_design
System analysis and_designSystem analysis and_design
System analysis and_design
 
Symfony 2
Symfony 2Symfony 2
Symfony 2
 
Story telling and_narrative
Story telling and_narrativeStory telling and_narrative
Story telling and_narrative
 

Recently uploaded

The Role of IoT in Australian Mobile App Development - PDF Guide
The Role of IoT in Australian Mobile App Development - PDF GuideThe Role of IoT in Australian Mobile App Development - PDF Guide
The Role of IoT in Australian Mobile App Development - PDF Guide
Shiv Technolabs
 
Using LLM Agents with Llama 3, LangGraph and Milvus
Using LLM Agents with Llama 3, LangGraph and MilvusUsing LLM Agents with Llama 3, LangGraph and Milvus
Using LLM Agents with Llama 3, LangGraph and Milvus
Zilliz
 
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-InTrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc
 
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdfWhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
ArgaBisma
 
How to build a generative AI solution A step-by-step guide (2).pdf
How to build a generative AI solution A step-by-step guide (2).pdfHow to build a generative AI solution A step-by-step guide (2).pdf
How to build a generative AI solution A step-by-step guide (2).pdf
ChristopherTHyatt
 
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
Kief Morris
 
“Deploying Large Language Models on a Raspberry Pi,” a Presentation from Usef...
“Deploying Large Language Models on a Raspberry Pi,” a Presentation from Usef...“Deploying Large Language Models on a Raspberry Pi,” a Presentation from Usef...
“Deploying Large Language Models on a Raspberry Pi,” a Presentation from Usef...
Edge AI and Vision Alliance
 
(CISOPlatform Summit & SACON 2024) Digital Personal Data Protection Act.pdf
(CISOPlatform Summit & SACON 2024) Digital Personal Data Protection Act.pdf(CISOPlatform Summit & SACON 2024) Digital Personal Data Protection Act.pdf
(CISOPlatform Summit & SACON 2024) Digital Personal Data Protection Act.pdf
Priyanka Aash
 
Use Cases & Benefits of RPA in Manufacturing in 2024.pptx
Use Cases & Benefits of RPA in Manufacturing in 2024.pptxUse Cases & Benefits of RPA in Manufacturing in 2024.pptx
Use Cases & Benefits of RPA in Manufacturing in 2024.pptx
SynapseIndia
 
How RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptxHow RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptx
SynapseIndia
 
Data Integration Basics: Merging & Joining Data
Data Integration Basics: Merging & Joining DataData Integration Basics: Merging & Joining Data
Data Integration Basics: Merging & Joining Data
Safe Software
 
Feature sql server terbaru performance.pptx
Feature sql server terbaru performance.pptxFeature sql server terbaru performance.pptx
Feature sql server terbaru performance.pptx
ssuser1915fe1
 
How to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptxHow to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptx
Adam Dunkels
 
leewayhertz.com-AI agents for healthcare Applications benefits and implementa...
leewayhertz.com-AI agents for healthcare Applications benefits and implementa...leewayhertz.com-AI agents for healthcare Applications benefits and implementa...
leewayhertz.com-AI agents for healthcare Applications benefits and implementa...
alexjohnson7307
 
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyyActive Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
RaminGhanbari2
 
July Patch Tuesday
July Patch TuesdayJuly Patch Tuesday
July Patch Tuesday
Ivanti
 
The Rise of AI in Cybersecurity How Machine Learning Will Shape Threat Detect...
The Rise of AI in Cybersecurity How Machine Learning Will Shape Threat Detect...The Rise of AI in Cybersecurity How Machine Learning Will Shape Threat Detect...
The Rise of AI in Cybersecurity How Machine Learning Will Shape Threat Detect...
digitalxplive
 
Introduction-to-the-IAM-Platform-Implementation-Plan.pptx
Introduction-to-the-IAM-Platform-Implementation-Plan.pptxIntroduction-to-the-IAM-Platform-Implementation-Plan.pptx
Introduction-to-the-IAM-Platform-Implementation-Plan.pptx
313mohammedarshad
 
Girls call Kolkata 👀 XXXXXXXXXXX 👀 Rs.9.5 K Cash Payment With Room Delivery
Girls call Kolkata 👀 XXXXXXXXXXX 👀 Rs.9.5 K Cash Payment With Room Delivery Girls call Kolkata 👀 XXXXXXXXXXX 👀 Rs.9.5 K Cash Payment With Room Delivery
Girls call Kolkata 👀 XXXXXXXXXXX 👀 Rs.9.5 K Cash Payment With Room Delivery
sunilverma7884
 
Tirana Tech Meetup - Agentic RAG with Milvus, Llama3 and Ollama
Tirana Tech Meetup - Agentic RAG with Milvus, Llama3 and OllamaTirana Tech Meetup - Agentic RAG with Milvus, Llama3 and Ollama
Tirana Tech Meetup - Agentic RAG with Milvus, Llama3 and Ollama
Zilliz
 

Recently uploaded (20)

The Role of IoT in Australian Mobile App Development - PDF Guide
The Role of IoT in Australian Mobile App Development - PDF GuideThe Role of IoT in Australian Mobile App Development - PDF Guide
The Role of IoT in Australian Mobile App Development - PDF Guide
 
Using LLM Agents with Llama 3, LangGraph and Milvus
Using LLM Agents with Llama 3, LangGraph and MilvusUsing LLM Agents with Llama 3, LangGraph and Milvus
Using LLM Agents with Llama 3, LangGraph and Milvus
 
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-InTrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
 
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdfWhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
 
How to build a generative AI solution A step-by-step guide (2).pdf
How to build a generative AI solution A step-by-step guide (2).pdfHow to build a generative AI solution A step-by-step guide (2).pdf
How to build a generative AI solution A step-by-step guide (2).pdf
 
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
 
“Deploying Large Language Models on a Raspberry Pi,” a Presentation from Usef...
“Deploying Large Language Models on a Raspberry Pi,” a Presentation from Usef...“Deploying Large Language Models on a Raspberry Pi,” a Presentation from Usef...
“Deploying Large Language Models on a Raspberry Pi,” a Presentation from Usef...
 
(CISOPlatform Summit & SACON 2024) Digital Personal Data Protection Act.pdf
(CISOPlatform Summit & SACON 2024) Digital Personal Data Protection Act.pdf(CISOPlatform Summit & SACON 2024) Digital Personal Data Protection Act.pdf
(CISOPlatform Summit & SACON 2024) Digital Personal Data Protection Act.pdf
 
Use Cases & Benefits of RPA in Manufacturing in 2024.pptx
Use Cases & Benefits of RPA in Manufacturing in 2024.pptxUse Cases & Benefits of RPA in Manufacturing in 2024.pptx
Use Cases & Benefits of RPA in Manufacturing in 2024.pptx
 
How RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptxHow RPA Help in the Transportation and Logistics Industry.pptx
How RPA Help in the Transportation and Logistics Industry.pptx
 
Data Integration Basics: Merging & Joining Data
Data Integration Basics: Merging & Joining DataData Integration Basics: Merging & Joining Data
Data Integration Basics: Merging & Joining Data
 
Feature sql server terbaru performance.pptx
Feature sql server terbaru performance.pptxFeature sql server terbaru performance.pptx
Feature sql server terbaru performance.pptx
 
How to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptxHow to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptx
 
leewayhertz.com-AI agents for healthcare Applications benefits and implementa...
leewayhertz.com-AI agents for healthcare Applications benefits and implementa...leewayhertz.com-AI agents for healthcare Applications benefits and implementa...
leewayhertz.com-AI agents for healthcare Applications benefits and implementa...
 
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyyActive Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
 
July Patch Tuesday
July Patch TuesdayJuly Patch Tuesday
July Patch Tuesday
 
The Rise of AI in Cybersecurity How Machine Learning Will Shape Threat Detect...
The Rise of AI in Cybersecurity How Machine Learning Will Shape Threat Detect...The Rise of AI in Cybersecurity How Machine Learning Will Shape Threat Detect...
The Rise of AI in Cybersecurity How Machine Learning Will Shape Threat Detect...
 
Introduction-to-the-IAM-Platform-Implementation-Plan.pptx
Introduction-to-the-IAM-Platform-Implementation-Plan.pptxIntroduction-to-the-IAM-Platform-Implementation-Plan.pptx
Introduction-to-the-IAM-Platform-Implementation-Plan.pptx
 
Girls call Kolkata 👀 XXXXXXXXXXX 👀 Rs.9.5 K Cash Payment With Room Delivery
Girls call Kolkata 👀 XXXXXXXXXXX 👀 Rs.9.5 K Cash Payment With Room Delivery Girls call Kolkata 👀 XXXXXXXXXXX 👀 Rs.9.5 K Cash Payment With Room Delivery
Girls call Kolkata 👀 XXXXXXXXXXX 👀 Rs.9.5 K Cash Payment With Room Delivery
 
Tirana Tech Meetup - Agentic RAG with Milvus, Llama3 and Ollama
Tirana Tech Meetup - Agentic RAG with Milvus, Llama3 and OllamaTirana Tech Meetup - Agentic RAG with Milvus, Llama3 and Ollama
Tirana Tech Meetup - Agentic RAG with Milvus, Llama3 and Ollama
 

Sending email with send grid and laravel

  • 1. Sending Emails with SendGrid and Laravel Sayed Ahmed Computer Engineering, BUET, Bangladesh (2001) MSc. Computer Science, U of Manitoba, Canada Exploring Computing from 1996
  • 2. Requirements  A SendGrid Account ◦ Cloud based email delivery services ◦ http://sendgrid.com/  Beanstalkd ◦ Email queue ◦ http://kr.github.io/beanstalkd/  Laravel go mail worker ◦ Laravel Mail sender using Sendgrid [as an example] ◦ https://github.com/zackkitzmiller/laravel-go-mail- worker ◦ https://github.com/zackkitzmiller/laravel-go-mail- worker/blob/master/laravel-go-mail- worker/app/commands/QueueEmailCommand.php ◦ https://github.com/zackkitzmiller/laravel-go-mail- worker/blob/master/go/src/zackkitzmiller/laravel-go-mail-worker/main.go
  • 3. Must Watch  Mail Queue configuration for Laravel ◦ https://github.com/laravel/laravel/blob/mas ter/app/config/queue.php  Basic Mail Configuration for Laravel [Not a Must] ◦ https://github.com/laravel/laravel/blob/mas ter/app/config/mail.php
  • 4. How These All Will Work  You need to queue the message in Beanstalkd ◦ You need to configure Laravel and Laravel Go Mailer for that ◦ From your code, you need to use methods to queue the message  $message = "This is a queue test job. We won't really need to pass data for this demo.";  Queue::push('QueueDemo', array('message' => $message)); ◦ This apparently looks like will also work  Mail::queueOn('queue-name', 'emails.welcome', $data, function($message) { $message  ->to('foo@example.com', 'John Smith')  ->subject('Welcome!'); }); ◦ Then the GO application will send this email  It’s Laravel go mail worker ◦ Then Go mailer will use SendGrid to send the mail
  • 5. How These All Will Work  Configuration for Go mail worker ◦ BEANSTALKD: location of the beanstalk installation (e.g. localhost:11300) ◦ SENDGRID_USER: username for sendgrid account ◦ SENDGRID_PASS: password for sendgrid account
  • 6. Installation  Install Go Mailer ◦ Artisan command email:send. Will do that for you  Not sure yet that it will work; after working with it, I will update ◦ Though you can get the copy of the Laravel-go-mailer and use that for sure
  • 7. Miscellaneous  How to Download and Install Beanstalkd ◦ http://kr.github.io/beanstalkd/download.html ◦ Src: git clone git://github.com/kr/beanstalkd.git ◦ Install:  Mac: sudo port install beanstalkd  Debian: sudo apt-get install beanstalkd  Ubuntu: sudo apt-get install beanstalkd  Fedora: su -c 'yum install beanstalkd'  Sending emails from Laravel using Mail Servers such as SwiftMailer ◦ http://laravel.com/docs/mail  Mail Queue tutorial for Laravel ◦ http://vimeo.com/64779946
  • 8. Miscellaneous  Beanstalkd listed as the default in Laravel-go-mailer queue config file ◦ https://github.com/zackkitzmiller/laravel- go-mail-worker/blob/master/laravel-go- mail-worker/app/config/queue.php  These are the environment variables ◦ Set SENDGRID_USER, SENDGRID_PASS, and BEANSTALKD env vars ◦ Can be set in Linux profile type files  Also from within PHP you can set
  • 9. Environment Variables and PHP  echo 'My username is ' .$_ENV["USER"] . '!' ;  // Example use of getenv() $ip = getenv('REMOTE_ADDR');  putenv("UNIQID=$uniqid"); 
  • 10. Beanstalkd Configuration File Content  You can know but you will not need to work with it much for basic functionality ◦ [program:qlistener] ◦ command=php /var/www/laravel/artisan queue:listen process_name=%(program_name)s ◦ numprocs=1 ◦ numprocs_start=0 ◦ autostart=true ◦ autorestart=true ◦ startsecs=1 ◦ startretries=3 ◦ exitcodes=0,2 ◦ stopsignal=TERM ◦ stopwaitsecs=10
  • 11. Beanstalkd Configuration File Content ◦ user=ubuntu ◦ redirect_stderr=false ◦ stdout_logfile=/var/log/supervisor/qlistener-stdout.log ◦ stdout_logfile_maxbytes=50MB ◦ stdout_logfile_backups=10 ◦ stdout_capture_maxbytes=0 ◦ stdout_events_enabled=false ◦ stderr_logfile=/var/log/supervisor/qlistener-stderr.log ◦ stderr_logfile_maxbytes=50MB ◦ stderr_logfile_backups=10 ◦ stderr_capture_maxbytes=0 ◦ tderr_events_enabled=false environment=LARAVEL_ENV="production" ◦ serverurl=AUTO