Last active
June 20, 2023 21:46
Revisions
-
yebt revised this gist
Jun 20, 2023 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,6 @@ # storage/app/dkim/private_key.txt #here write the private key generated from the dkim support on your host #or from this great tool: https://tools.socketlabs.com/dkim/generator # in the host manage go to cpanel zone editor and search dkim._domainkey.you_domain.com or default._domainkey.you_domain.com # CPANEL # Email Deliverability > [press "Manage" button of select domain] > see the dkim menu -
yebt revised this gist
Jun 20, 2023 . 1 changed file with 3 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,4 @@ # storage/app/dkim/private_key.txt #here write the private key generated from the dkim support on your host #or from this great tool: https://tools.socketlabs.com/dkim/generator # in the host manage go to cpanel zone editor and search dkim._domainkey.you_domain.com or default._domainkey.you_domain.com -
yebt revised this gist
Nov 1, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,7 @@ class GeneralMail extends Mailable{ #... public function build() { $this->subject(__('General Mail')) ->view('mails.resetpassword') ->text('mails.resetpassword_plain'); add_dkim_to_mailable($this); // this call the helper -
yebt created this gist
Nov 1, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ <?php #... # app/Mail/ResetPassword.php #... class GeneralMail extends Mailable{ #... public function build() { $this->subject(__('Reset Password')) ->view('mails.resetpassword') ->text('mails.resetpassword_plain'); add_dkim_to_mailable($this); // this call the helper return $this; } } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,29 @@ <?php #-... # app/Helpers/Helper.php if (!function_exists('add_dkim_to_mailable')) { /** * This function add a Dim sign to mailable entities. * @param Mailable $mailable the mailable entity * @return void */ function add_dkim_to_mailable(Illuminate\Mail\Mailable $mailable) { $mailable->withSwiftMessage(function (\Swift_Message $message) { // DKIM INFO $dkim_privatekey = config('manualdkim.private_key'); $dkim_selector = config('manualdkim.selector'); $dkim_domain = config('manualdkim.domain'); if ( empty($dkim_privatekey) && (!file_exists($dkim_privatekey) && (empty($dkim_selector) && empty($dkim_domain))) ) { return; } $signer = new \Swift_Signers_DKIMSigner(file_get_contents($dkim_privatekey), $dkim_domain, $dkim_selector); $message->attachSigner($signer); }); } } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ <?php # this file is in `config/manualdkim.php` return [ 'private_key' => env('DKIM_PRIVATE_KEY', storage_path('app/dkim/private_key.txt')), 'selector' => env('DKIM_SELECTOR', 'default'), 'domain' => env('DKIM_DOMAIN', null), ]; This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ # app/dkim/private_key.txt #here write the private key generated from the dkim support on your host #or from this great tool: https://tools.socketlabs.com/dkim/generator