Created
April 16, 2024 18:35
-
-
Save calevans/09bd14d2def53f6ae16ef265d4484a05 to your computer and use it in GitHub Desktop.
This file contains 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 characters
<?php | |
use FluentCrm\App\Models\Campaign; | |
use FluentCrm\Framework\Database\Orm; | |
use FluentCrm\App\Models\Lists; | |
$email = Campaign::create( | |
[ | |
'email_subject'=>'Test Subject ' . date('Y-m-d H:i:s'), | |
'email_body'=>'This is the body of the email.', | |
'type'=>'campaign', | |
'status' => 'scheduled', | |
//'scheduled_at' => date('Y-m-d H:i:s'), | |
'title' => 'Test Title ' . date('Y-m-d H:i:s'), | |
'template_id' => 0, | |
] | |
); | |
$subscriberIds = $email->getSubscribeIdsByList([['list'=>'1','tag'=>'all']]); | |
//$subscriberIds = $email->getSubscriberIdsBySegmentSettings(['subscribers'=>[0=>['list'=>'1','tag'=>'all']]])['subscriber_ids']; | |
$email->subscribe($subscriberIds); | |
//$email->update(); | |
//var_export($email->subscribeBySegment(['subscribers'=>[0=>['list'=>'1','tag'=>'all']]])); | |
//$email->update(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment