Skip to content

Commit

Permalink
Merge pull request #1408 from bakaphp/cronjob-caddielab
Browse files Browse the repository at this point in the history
refactor: billing_url_pro
  • Loading branch information
FredPeal committed May 30, 2024
2 parents 35529fa + 5469524 commit d9904c4
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@ public function __construct(
public function handle()
{
$peoples = PeoplesRepository::getByDaysCreated(7, $this->app);
$this->sendMails($peoples, 'join-caddie');
$this->sendMails($peoples, 'join-caddie', $this->app->get('billing_url'));

$peoples = PeoplesRepository::getByDaysCreated(28, $this->app);
$this->sendMails($peoples, 'deal-caddie');
$this->sendMails($peoples, 'deal-caddie', $this->app->get('billing_url_pro'));
}

public function sendMails(Collection $peoples, string $template)
public function sendMails(Collection $peoples, string $template, string $baseUrl)
{
foreach ($peoples as $people) {
$email = $people->emails()->first();
$url = $this->app->get('billing_url') . '/' . '?email=' . $email->value . '&paid=false';
$url = $baseUrl . '/' . '?email=' . $email->value . '&paid=false';
$notification = new Blank(
$template,
['membershipUpgradeUrl' => $url, 'app' => $this->app],
Expand Down

0 comments on commit d9904c4

Please sign in to comment.