summaryrefslogtreecommitdiff
path: root/addons/mass_mailing/models
AgeCommit message (Collapse)Author
2019-04-15[IMP] mass_mailing : improve heuristics to handle seen mailsDavid Beguin
Currently the assumption is that if email field doesn't exist on the target model the mail field has to be email_from. So if one model is targeted and does not have a field email nor email_from the seen list will raise as it is searching at least on email_from on the targeted model table. Better heuristics implemented here is to apply the same rule as 'get email field' from MailThread.message_get_default_recipients§). It searches for email_normalized (address mixin), email_from, partner_email and email fields in addition to partner_id which covers all use cases in odoo. Related to task ID 1907292 Linked to PR #28535 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-04-09[MERGE] forward port branch saas-12.1 up to 6d4940675f1Christophe Simonis
2019-04-09[MERGE] forward port branch 12.0 up to ea1fc124efcChristophe Simonis
2019-04-08[FIX] mass_mailing: fix statistic state computationThibault Delavallée
Replied / Bounced / Opened states should be computed prior to Sent state. Indeed Sent is the default state once the email is sent. Then replied, bounced and opened are states that happen after sending the email. It is therefore necessary to re-order the state computation to correctly compute the statistic state. Related to task ID 1924711 Linked to PR #32496 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-03-29[MERGE] forward port branch saas-12.1 up to c0cf4049b2aChristophe Simonis
2019-03-29[MERGE] forward port branch 12.0 up to 09fb2469b49Christophe Simonis
2019-03-29[MERGE] forward port branch saas-11.3 up to ec29b4d3648Christophe Simonis
2019-03-28[MERGE] forward port branch 11.0 up to 4231103cc99Christophe Simonis
2019-03-27[FIX] mass_mailing: default valueNicolas Martinelli
Do not raise if data have been deleted. Since the fields are not required, do not fallback. opw-1959184 closes odoo/odoo#32163 Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-03-25[MERGE] forward port branch 11.0 up to 0196a6feb5aChristophe Simonis
2019-03-20[FIX] mass_mailing: support partner_id fieldJeremy Kersten
Manual cherrypick of 83b37a8 sale.order but also event.track need to use partner_id as email field Closes #31954 closes odoo/odoo#31967 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-03-11[MERGE] forward port branch saas-12.1 up to 2b3296bbf8bChristophe Simonis
2019-03-08[MERGE] forward port branch 12.0 up to c023d0784f2Christophe Simonis
2019-03-06[FIX] mass_mailing: inline image not supportedJulien (juc) Castiaux
Inline (base64) embedded images are not supported by most mail clients (gmail on top of them), this fix save those images as attachments and replace the src tag with the url of the generated image so the image correctly renders. opw-1929940 closes odoo/odoo#31532 Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
2019-02-22[MERGE] forward port branch saas-12.1 up to 0f4abc5c228Christophe Simonis
2019-02-21[MERGE] forward port branch 12.0 up to 84143a34b31Christophe Simonis
2019-02-20[MERGE] forward port branch 11.0 up to de8cefcef4dChristophe Simonis
2019-02-20[MERGE] forward port branch saas-11.3 up to 2c495502aa3Christophe Simonis
2019-02-13[FIX] mass_mailing: make retry failed mail work with keep archive set to FalseHugo Adan
Let M be a mass_mailing. For all messages m related to M, retry_failed_mail removes the mail statistics of m before putting M 'in_queue'. Since there are no statistics on m, its recipient is returned by the function get_remaining_recipients when called by send_mail once M is processed. However when keep archive is set to False, the 'mail.mail' records are automatically removed. As a results their statistics are not removed, and thus these mails are not retried. closes odoo/odoo#30158
2019-01-31[MERGE] forward port branch 12.0 up to cb8fefa8999Christophe Simonis
2019-02-04[MERGE] forward port branch saas-12.1 up to 4524ad06a8aChristophe Simonis
2019-01-29[MERGE] forward port branch 11.0 up to 36d96e01503Christophe Simonis
2019-01-30[FIX] mass_mailing: support partner_id fieldMartin Trigaux
A sale.order is an authorised model for mass mailing but it does not have an email or email_from field. When trying to send a mass mailing campaign on sale orders, an error was raised as sale_order.email_from does not exists closes odoo/odoo#30220
2019-01-29[MERGE] forward port branch saas-11.3 up to cd5c8a02f95Christophe Simonis
2018-11-28[FIX] mass_mailing: don't short url before renderingJeremy Kersten
Before this commit, if you generate the href with jinja/mako syntax, the un-rendered url will be shortened. So: href="https://www.odoo.com?id=${object.id}" will become: href="https://www.odoo.com/r/asw" where https://www.odoo.com/r/asw redirect to https://www.odoo.com?id=${object.id} instead of https://www.odoo.com?id=1 Adaptation of #28540 for 11.0 version. opw-1903803 closes #29083
2018-11-20[IMP] mass_mailing : apply email_normalized on _get_opt_out_listDavid Beguin
To avoid sending mail to an opted-out mass_mailing_contact with email address that is not strictly an email address (a <a@a.com> instead of a@a.com), the the get_opt_out method must be adapted to use the email_normalized field, as this method is only useful for that specific model. Task ID : 1896677
2018-11-20[IMP] tools, mail : adds email normalization method in mail toolsDavid Beguin
In order to normalize email independently from the mail.address.mixin model.
2018-11-20[IMP] mail, mass_mailing, mass_mailing_crm : Use normalized email in ↵David Beguin
unsubscribe link Use the email_normalized from mail.address.mixin if available to get always a normalized email address in the unsubscribe link. That allows to simplify the search on email address in the controllers -> Check blacklist, send feedback, etc.. Task ID 1896677
2018-11-20[IMP] mail : apply mail.address.mixin on blacklistDavid Beguin
Apply the mail.address.mixin on blacklist mixin. So that every model inheriting the blacklist.mixin will also inherit the address.mixin. That simplify also the comparaison to - and the searches on - the blacklist. Task ID 1896677
2018-11-15[IMP] mass_mailing: improve onboardingGeoffroy Larue
Purpose : this commit improve various elements of the mass mailing interface : - make recipients field in mass mailing form required and add "mass mailing contact" in selection - new "Archive" button and color picker in dropdown menus of mailing lists and mailings kanban views. - various little improvements in labels closes odoo/odoo#28497
2018-11-16[FIX] mass_mailing: fix slow contact number queryOlivier Dony
The query was computing the count for all mailing lists, not just the one being requested. This prevents optimizing the SELECT with indexes. In addition, using a subselect for the blacklist forced a full table scan on the contacts - switching to a LEFT JOIN avoids that. With a blacklist of a few hundred thousand entries, and a table of mailing list contacts in the same order of magnitude, this brings the SELECT from 3+ seconds down to 3 milliseconds - with the same result. Bonus: no need to perform the regexp extraction of emails to test for NULL values -> substring(x) is NULL iff x is NULL.
2018-11-14[FIX] mass_mailing : returns set of normalized email in _get_opt_out_listDavid Beguin
If a recipient has a formatted email address like 'A <a@b.com>', the returned opt_out list must contain normalized email ('a@b.com') in order to be comparable during the get_mail_values of the mail.compose.message. Otherwize, It won't match. Task ID : 1909314 Closes PR #28667
2019-01-17[IMP] web_editor,*: Refactoring the wysiwyg editor and 'html' fieldChristophe Matthieu
* Creating a new structure by transforming all the plugins in the library using the odoo inheritance system. Plugins are easier to implement with the AbstractPlugin to add Odoo behaviors. * From now on, the methods of the library (in this case Summernote) can no longer be called by other modules or files. Only the wysiwyg widgets can access it, to simplify the updating process. The wysiwyg object serves as an interface. * Depending on the options the snippets will be loaded or not, the editor will be in an iframe or not... all of this is transparent from the outside. * Regarding iframes, all controllers related to editing have been removed: the new API no longer needs them. This speeds up loading, eases testing and removes complexity for the same features. PUBLIC FEATURES There are several public methods on the Wysiwyg class: * Wysiwyg.prepare (WidgetParent): returns a deferred resolved when the library (xml, lazy, assets...) is loaded. * Wysiwyg.getRange (DOM): returns the range (selection in the dom) * Wysiwyg.setRange (startNode, startOffset, endNode, endOffset): creates a range (selection in the dom) * Wysiwyg.setRangeFromNode (DOM, options) that creates a range from an element (option available to select all, start or end) A jQuery selector was added: :o_editable, which indicates whether the current element is editable. That is, if it is contained in a tag with the attribute 'contentEditable = "true"' or in a tag with the class o_editable. Several methods are also present: * focusIn: makes a focus and places the cursor at the beginning of the element * focusInEnd: makes a focus and places the cursor at the end of the element * selectContent: makes a focus and selects the content HTML FIELD The HTML field can receive different options: * style-inline: {boolean} transforms a class into an inline style when saving and vice versa when reading. * no-attachment: {boolean} prevents the use of attachments (in media dialog) * cssEdit: {xml_id} to use a template containing the css to loaded in an iframe when editing * cssReadonly: {xml_id} to use a template containing the css to load into an iframe when viewing in readonly * snippets: {xml_id} snippets template (can be used with or without cssEdit) * wrapper: {template} qweb static template (containing a tag: id = "wrapper") that will include the content during editing (removed on save) MASS MAILING A widget was created for mass mailing. There are now two fields: body_html and body_arch. body_arch contains the code with the class without conversion into inline style, useful when editing and one with the inline style that is visible in readonly mode and sent by email. Advantage: no spreading errors, able to update css/theme, able to do more changes when converting to inline style so that a maximum of mail clients have an impeccable rendering. Co-authored-by: Antoine Guenet <age@odoo.com>
2019-01-17[IMP] mass_mailing: differentiate mailing name from emails subjectThibault Delavallée
Purpose of this task is to allow marketing people to differentiate the mailing name (internal reference) from the subject used in the mailing emails. Mailing name is actually the UTM source name as mass mailing inherits from it. Being able to edit it independently from the subject allows to better categorize / filter mailings without sending technical terms to customers. Marketing users could also change and tweak mailing subject without disorganizing the pipe and changing the URM source name. Demo data are updated accordingly to have both subject and mailing names. This commit is linked to task ID 1917602 and PR #29514.
2019-01-14[REF] link_tracker, mass_mailing: simplify add_click method and add testsThibault Delavallée
In this commit we rewrite a bit add_click in order to remove the inlined sudo and ease inheritance and parameter management inside the method. Access through controllers is sudo-ed as the main API method is now done with current user access rights. This commit is linked to task ID 1904277 and PR #28242.
2018-12-11[IMP] mass_mailing: add responsible in mailing viewThibault Delavallée
Otherwise it is not possible to change it in order to re-assign the mailing. Also update the field label in order to better match its intended use. This commit is linked to task ID 1907994 and PR #28533.
2018-11-05[FIX] mass_mailing : restore import mass_mailing.contact into mass_mailing.listDavid Beguin
Since the opt out per mailing list, the intermediate model was used to list all the recipient of a mailing list. The side effect was that importing new contacts into mailing list was not possible anymore. Also, creation of a new contact into a mailing list was made indirectly by creating a new many2many record between contaxct and list, which was not really user friendly. This commit restores the mailing contact model as the view of the mailing list recipients. In other terms, the contact import is restored. An opt-out computed field as been added to be able to filter on opted out contact inside the mailing list recipients view. This opt_out field SHOULD NOT be used in a form view as it need the active mailing list id in the context in order to be computable and searchable. This field has no sense without this active mailing list id context. Task ID 1891228 Linked with blacklist and opt out per mailing task (ID 33224) Closes PR #27632
2018-10-15[FIX] mass_mailing: don't forward contextNicolas Seinlet
Don't forward context from mass mailing to partners view. When grouping mass mailing by state, passing context makes Odoo trying to group partners by state, and then get a traceback. closes odoo/odoo#27775
2018-11-19[FIX] mass_mailing: fix typos in 8545e05fc0aaad1c942317f6b4ac120da415b3ccOlivier Dony
TODO: add test coverage for this computed field closes odoo/odoo#28797
2018-10-05[FIX] mail, mass_mailing: remove implicit dependency on mass_mailinglen-odoo
Fix to commit: a1d6064dcc6d349c02556453e1aa052e60db41c0 Which erroneously put a mass_mailing method in mail, as mail.mail.statistics is defined in mass_mailing. Since it does not depend on the records, it been extracted from the loop. opw 1890461 closes odoo/odoo#27431
2018-10-02[FIX] mass_mailing : sanitize email used for counters and comparisonDavid Beguin
Purpose is to fix the comparison between mass mailing record email field and blacklist entries by sanitizing email to ensure comparison is done on same basis as what is stored in blacklist table. Also fix the action merge where the extraction of email is needed before comparing to the blacklist. This commit is related to task ID 33224 (original blacklist implementation done for v12) and its PR #25966 as well as task ID 1889703 (tests and fixes) and its PR #27330. Done with collaboration of @dbeguin.
2018-10-01[MERGE] forward port branch saas-11.4 up to 57e387b6452Christophe Simonis
2018-10-01[MERGE] forward port branch saas-11.3 up to e980af9df00Christophe Simonis
2018-09-27[REF] *: adapt code to new related default behaviourAdrian Torres
This commit adapts the business code to changes introduced by the parent commit in order to keep the same behaviour as before. All readonly=False fields will have to be checked afterwards to confirm that the business case requires write access to the source field.
2018-09-26[MERGE] forward port branch 11.0 up to fd122aec521Christophe Simonis
2018-09-26[MERGE] forward port branch saas-15 up to a0d832efdcdChristophe Simonis
2018-09-26[MERGE] forward port branch saas-14 up to 218eec54824Christophe Simonis
2018-09-21[FIX] mass_mailing: make campaign default to non-A/B testingOlivier Dony
In A/B testing mode, a given recipient will only ever receive a single email from a given mass-mailing campaign, no matter how many mailings were sent to them. This is useful for A/B-testing various mailings in order to check their results. But is very difficult to understand for users who simply want to organize their mailings into campaigns. Additionally, the A/B testing option is hidden as a technical feature, so it is hard to discover in order to troubleshoot unexpected number of emails sent by a given mailing. It will be safer to keep it off by default. (keeping the parameter explicit, to better show that it is on purpose) This partially reverts dee5c31264be4c13f36615f5e4fb2a375c1c38d8
2018-09-20[IMP] mass_mailing: redirect to filtered view when clicking on stat buttonsThibault Delavallée
Purpose of this commit is to improve user experience in mass mailing by redirecting users on filtered views when clicking on sent / delivered / read / opened / clicked stat buttons. Currently it redirects to the statistics view which is not the most useful one. This commit is linked to task ID 1885121 and closes PR #27003.
2018-09-18[MERGE] forward port branch saas-11.4 up to a1b384d66beChristophe Simonis