SlideShare una empresa de Scribd logo
1 de 12
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

Más contenido relacionado

La actualidad más candente

Angular2RoutingSetupByShubham
Angular2RoutingSetupByShubhamAngular2RoutingSetupByShubham
Angular2RoutingSetupByShubham
Shubham Verma
 
SocketIOSetupWithAngularJSAppByShubham
SocketIOSetupWithAngularJSAppByShubhamSocketIOSetupWithAngularJSAppByShubham
SocketIOSetupWithAngularJSAppByShubham
Shubham Verma
 

La actualidad más candente (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...
 

Destacado (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 a Sending email with send grid and laravel

Apache Wizardry - Ohio Linux 2011
Apache Wizardry - Ohio Linux 2011Apache Wizardry - Ohio Linux 2011
Apache Wizardry - Ohio Linux 2011
Rich Bowen
 
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
 
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.
 
Apache Web Services
Apache Web ServicesApache Web Services
Apache Web Services
lkurriger
 
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 a 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
 

Más de Sayed Ahmed

Más de 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
 

Último

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 

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