|

Adding Email Headers in Laravel Application

Adding email headers in Laravel application is quite simple. SwiftMessage can be customized using withSwiftMessage method of Mailable base class: https://laravel.com/docs/8.x/mail#customizing-the-swiftmailer-message However you have to remember to do it every time you create a new “mailable” class. Some mail APIs require you to put a special header each time you send an email. In this…

Retrying and Logging Requests with Guzzle

When consuming 3d party API, you may want to do two things: In this article we will look at how to implement the above features using Guzzle, a popular PHP library for making API calls. Let us scaffold our app composer init composer require guzzlehttp/guzzle:~6.0 composer require monolog/monolog composer require –dev phpunit/phpunit:^8 We will be…