Skip to main content

Real-World Example

ABC Collections schedules a campaign for consumers like Jane. At the scheduled daily run, the portal finds the campaign, snapshots the group, sends eligible Email, SMS, or EcoLetter messages in queued jobs, and updates campaign tracker results.

Visual Flow

How It Should Work

  • It should process due creditor campaigns through scheduled commands and queued jobs.
  • It should respect consumer permissions, opt-out state, and channel rules before sending.
  • It should update campaign tracker counts for sent, viewed, downloaded, and action activity.
  • It should handle EcoLetter deductions and records when EcoLetters are sent.

How It Should Not Work

  • It should not send campaign messages to consumers outside the selected group snapshot.
  • It should not ignore unsubscribe or communication preference rules.
  • It should not block the creditor portal page while sending a large campaign.

Developer Notes

  • RunCampaignCommand is scheduled daily at 17:30.
  • Consumers are processed in chunks and individual messages are sent by queued jobs.
  • EcoMail Hub / EcoPortal has its own campaign command, but consumer-facing EcoLetters still appear in EcoMailbox when delivered to a consumer.
  • app/Console/Kernel.php
  • app/Console/Commands/RunCampaignCommand.php
  • app/Jobs/ProcessCampaignConsumersJob.php
  • app/Jobs/SendCampaignEmailSmsOrELetterJob.php
  • app/Jobs/SendSingleCampaignMessageJob.php
  • app/Services/CampaignTrackerService.php
Last modified on May 26, 2026