diff --git a/app/DataMapper/CompanySettings.php b/app/DataMapper/CompanySettings.php index 1e9cdb23bb..5f711ce28c 100644 --- a/app/DataMapper/CompanySettings.php +++ b/app/DataMapper/CompanySettings.php @@ -534,8 +534,10 @@ class CompanySettings extends BaseSettings public string $ses_access_key = ''; public string $ses_region = ''; public string $ses_topic_arn = ''; + public string $ses_from_address = ''; public static $casts = [ + 'ses_from_address' => 'string', 'ses_topic_arn' => 'string', 'ses_secret_key' => 'string', 'ses_access_key' => 'string', diff --git a/app/Http/ValidationRules/Account/BlackListRule.php b/app/Http/ValidationRules/Account/BlackListRule.php index bb279e02d7..8538ea385b 100644 --- a/app/Http/ValidationRules/Account/BlackListRule.php +++ b/app/Http/ValidationRules/Account/BlackListRule.php @@ -22,6 +22,7 @@ class BlackListRule implements ValidationRule { /** Bad domains +/- disposable email domains */ private array $blacklist = [ + "freedrops.org", "mailshan.com", "tabletship.com", "tiktook.lol", diff --git a/app/Models/Credit.php b/app/Models/Credit.php index 4f9c4fd962..baeeeb73a0 100644 --- a/app/Models/Credit.php +++ b/app/Models/Credit.php @@ -122,7 +122,7 @@ use Illuminate\Database\Eloquent\SoftDeletes; * @property \App\Models\Client $client * @property \App\Models\Vendor|null $vendor * @property-read \App\Models\Location|null $location - * @property-read mixed $pivotcredi + * @property-read mixed $pivot * @property-read \Illuminate\Database\Eloquent\Collection $activities * @property-read \Illuminate\Database\Eloquent\Collection $company_ledger * @property-read \Illuminate\Database\Eloquent\Collection $documents diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index c4b246bb7e..e69bbc9ac4 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -121,6 +121,7 @@ class AppServiceProvider extends ServiceProvider return $this; }); + Mail::extend('brevo', function () { return (new BrevoTransportFactory())->create( new Dsn( @@ -145,6 +146,30 @@ class AppServiceProvider extends ServiceProvider return $this; }); + // Macro to configure SES with runtime credentials + Mailer::macro('ses_config', function (string $key, string $secret, string $region = 'us-east-1', ?string $topic_arn = null) { + $config = [ + 'key' => $key, + 'secret' => $secret, + 'region' => $region, + 'version' => 'latest', + 'service' => 'email', + ]; + + $options = []; + if ($topic_arn) { + $options['ConfigurationSetName'] = $topic_arn; + } + + $sesClient = new \Aws\Ses\SesClient($config); + $transport = new \Illuminate\Mail\Transport\SesTransport($sesClient, $options); + + // @phpstan-ignore /** @phpstan-ignore-next-line **/ + Mailer::setSymfonyTransport($transport); + + return $this; + }); + //Prevents destructive commands from being run in hosted environments \DB::prohibitDestructiveCommands(Ninja::isHosted()); diff --git a/config/mail.php b/config/mail.php index a2ec64e79b..d0e3ad4753 100644 --- a/config/mail.php +++ b/config/mail.php @@ -51,6 +51,7 @@ return [ 'transport' => 'ses', ], + 'mailgun' => [ 'transport' => 'mailgun', ], diff --git a/config/ninja.php b/config/ninja.php index 14e012e73b..7df39279b9 100644 --- a/config/ninja.php +++ b/config/ninja.php @@ -257,7 +257,7 @@ return [ 'storecove_email_catchall' => env('STORECOVE_CATCHALL_EMAIL',false), 'qvalia_api_key' => env('QVALIA_API_KEY', false), 'qvalia_partner_number' => env('QVALIA_PARTNER_NUMBER', false), - 'pdf_page_numbering_x_alignment' => env('PDF_PAGE_NUMBER_X', -10), + 'pdf_page_numbering_x_alignment' => env('PDF_PAGE_NUMBER_X', -5), 'pdf_page_numbering_y_alignment' => env('PDF_PAGE_NUMBER_Y', -6), 'hosted_einvoice_secret' => env('HOSTED_EINVOICE_SECRET', null), 'e_invoice_quota_warning' => env('E_INVOICE_QUOTA_WARNING', 15), diff --git a/lang/en/texts.php b/lang/en/texts.php index 969da9c62f..9f6f20b02f 100644 --- a/lang/en/texts.php +++ b/lang/en/texts.php @@ -5629,6 +5629,8 @@ $lang = array( 'lang_Afrikaans' => 'Afrikaans', 'lang_Indonesian' => 'Indonesian', 'replaced' => 'Replaced', + 'ses_from_address' => 'SES From Address', + 'ses_from_address_help' => 'The Sending Email Address, must be verified in AWS', ); return $lang;