PHP code example of nandosr98 / laravel-remarketing
1. Go to this page and download the library: Download nandosr98/laravel-remarketing library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
nandosr98 / laravel-remarketing example snippets
return [
'send_after_hours' => 1, // Número de horas después de las cuales se enviará el correo
'queue_name' => 'remarketing', // Nombre de la cola
'queue_connection' => 'redis',
'model_related' => App\Models\MiProducto::class, // Modelo relacionado
'model_related_property_name' => 'producto_id', // Nombre del campo de la relación
'model_related_method_name' => 'producto', // Metodo de la relación para acceder a los datos
'mailable_class' => RemarketingMessage::class, // Clase utilizada para enviar el correo
'mail_name' => 'Sender Name', // Nombre del remitente del correo
'mail_subject' => 'Subject of the email',
'mail_view' => 'remarketing::default',
];
public function handle()
{
Mail::send(new RemarketingMessage($this->id));
}
public function build()
{
$remarketing = BaseRemarketing::where('id', $this->id)
->with(config('remarketing.model_related_method_name'))
->first();
if (!$remarketing) {
return null;
}
$remarketing->sent = true;
$remarketing->save();
return $this->view(config('remarketing.mail_view'))
->subject(config('remarketing.mail_subject'));
}