Difference mautic:emails:send & mautic:messages:send

Hello!
I’m not sure the documentation is really clear, what are the differences between:

mautic:emails:send
mautic:email:send
mautic:messages:send

?
Thank you.

1 Like

Thank you for your quick and useful answer!
I thought mautic:messages:send was there for backward capability, but it’s not the case, time to update the cron job.
Have a nice day dear Mautic user!

@RandomUser would you mind sharing the answer you received for this question? I’m trying to clean up any possible unnecessary cron jobs, and don’t fully understand mautic:messages:send. Thanks!

@marketsmart The cron job mautic:messages:send should be added to your list if you are using frequency rules rescheduled marketing campaign emails. (it concerned emails marked as Marketing Emails. Such emails will be inserted into a message queue IF frequency rules are setup as either systemwide or per contact.
This cron job will process this queue and reschedule sending these emails.
I am not quite sure why it mentions “messages” instead of “emails”, maybe the scope of the feature is meant to cover sms too.

The corn job mautic:emails:send should be used if you are queuing (all) emails to a spool file rather than sending them immediately. Every time the job runs it will send the emails in the queue.

More on Mautic cron jobs.

1 Like

@alban Thanks! Helps a lot. I was missing the “IF frequency rules are setup as either systemwide or per contact.” part. I do have campaign Marketing Emails going out, but I have not set any frequency rules. I do have email set up to queue to spool file. Any idea where the ‘message’ spool is located? I know the ‘email’ spool is install/app/spool/default. But anyways, I’ll keep mautic:emails:send and remove mautic:messages:send.

i am also looking for answer to this question.

mautic:messages:send is sending marketing emails which are rescheduled due to daily email limitations of that contct. You can set this limit in config / email settings / frequency

  1. If I have a limit for emails to be sent trough Amazon AWS of 14 emails / second
  2. I set for emails:send a --message-limit=10 in a loop each 1 second
  3. does messages:send really send the marketing emails to AWS or only prepares them to the Spool?

Help of the command is for me not quite explicit. And further more: this command cannot be limited as the other commands (with --limit=X , or --batch-limit=X …)?

php /var/www/html/m/bin/console mautic:messages:send -help
Description:
  Process sending of messages queue.

Usage:
  mautic:messages:send [options]
  mautic:campaigns:messagequeue
  mautic:campaigns:messages

Options:
  -c, --channel[=CHANNEL]      Channel to use for sending messages i.e. email, sms.
  -i, --channel-id=CHANNEL-ID  The ID of the message i.e. email ID, sms ID.
  -m, --message-id=MESSAGE-ID  ID of a specific queued message
      --bypass-locking         Bypass locking.
  -t, --timeout=TIMEOUT        If getmypid() is disabled on this system, lock files will be used. This option will assume the process is dead after the specified number of seconds and will execute anyway. This is disabled by default.
  -x, --lock_mode=LOCK_MODE    Allowed value are "pid" or "flock". By default, lock will try with pid, if not available will use file system [default: "pid"]
  -f, --force                  Deprecated; use --bypass-locking instead.
  -h, --help                   Display this help message
  -q, --quiet                  Do not output any message
  -V, --version                Display this application version
      --ansi                   Force ANSI output
      --no-ansi                Disable ANSI output
  -n, --no-interaction         Do not ask any interactive question
  -e, --env=ENV                The Environment name. [default: "prod"]
      --no-debug               Switches off debug mode.
  -v|vv|vvv, --verbose         Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Hello,
Plz watch this video, I explain everything what command does what and where.
I’m too lazy to repeat myself :slight_smile:

Spoiler:
for campaign emails mautic:campaigns:trigger sends campaign emails to the spool
for segment emails mautic:broadcast:send creates the spool if you have file queue turned on
mautic:emails:send is what you should use if you want to send out messages from the pool

--message-limit=10 will send 10 emails per exection. Here is a knowledgebase article about timing with SES:

Thank you very much for the video ! I watched it earlier before - so clearly explained ! Thank you again.

Still, messages:send is not there => I suppose it has nothing to do with sending emails, but only with SMS, popups or push notifications. Can you please confirm?


Regarding Amazon SES. What you say does make sense. Though, trough deep search and reading many posts here, I found out that, if mautic sends over 14 emails in a second, those emails will be ignored.

I suppose I have a very good VPS, that sends more than 14 emails in a second. Even if I set the limit to 300 as an example (14 emails/sec x 60 sec = 840 emails / min) , some emails are not sent by AWS.

Some contacts did confirmed that they did not received the email, although in mautic was marked as sent.

So I took another approach: I created a loop: as long as in the spool folder are files do: send 10 emails, wait 1 second.

I am confident that this method is the safest one.

If you run the email send command in ssh, how fast is the send done? Even if you have a great vps I doubt you reach 14/sec.

This is the reason why many marketers use multi thread sending.

Ups, you are right. I do not have always so many emails to send, so I cannot test right now.
But I set to receive a log-information if the cron job takes more than 30 seconds to run and, according to one of them, I have a sending rate of 5,7 emails / second.
=> thank you for doubting, I was wrong.

I am asking then … from where can it be, that some emails were not (sent) received. I will keep an eye open and look further on the logs and on contacts history.