The "launch" button of an email campaign mark the current campaign ready
to be processed. As sending all the mails is a pretty heavy operation,
it is done asynchronously in a cron. The cron was running every hour, it
means the cron was running even if there was no active campaign and it
has a best precision of 1 hour.
We now use the new mechanism of cron triggers (4b28f11) to schedule the
con execution at the time the campaign is configured to be sent. It
achieves a better precision and ensures the cron only runs when there are
stuff to process.
We still let the cron run once a day as a security until the cron
mechanisme proves reliable.
closes odoo/odoo#65124
Task: 2416741
Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
26 lines
1.2 KiB
XML
26 lines
1.2 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
<data noupdate="1">
|
|
<!-- Cron that process the mass mailing queue -->
|
|
<record id="ir_cron_mass_mailing_queue" model="ir.cron">
|
|
<field name="name">Mail Marketing: Process queue</field>
|
|
<field name="model_id" ref="model_mailing_mailing"/>
|
|
<field name="state">code</field>
|
|
<field name="code">model._process_mass_mailing_queue()</field>
|
|
<field name="user_id" ref="base.user_root" />
|
|
<field name="interval_number">1</field>
|
|
<field name="interval_type">days</field>
|
|
<field name="numbercall">-1</field>
|
|
<field eval="False" name="doall" />
|
|
</record>
|
|
<record id="mailing_list_data" model="mailing.list">
|
|
<field name="name">Newsletter</field>
|
|
</record>
|
|
<record id="mass_mailing_contact_0" model="mailing.contact">
|
|
<field name="name" model="res.users" eval="obj().env.ref('base.user_admin').name"/>
|
|
<field name="email" model="res.users" eval="obj().env.ref('base.user_admin').email"/>
|
|
<field name="list_ids" eval="[(6,0,[ref('mass_mailing.mailing_list_data')])]"/>
|
|
</record>
|
|
</data>
|
|
</odoo>
|