summaryrefslogtreecommitdiff
path: root/addons/website_mass_mailing/controllers/main.py
AgeCommit message (Collapse)Author
2021-02-03[FIX] website_mass_mailing, *: add fix for missing google_recaptchaqsm-odoo
*: website In 14.0, the website_mass_mailing now uses ReCaptcha. The problem is that we forgot to add the related module as a dependency. It thus works on runbot because it is indirectly installed by other apps but the newsletter popup does not work anymore if only website_mass_mailing is installed. In master, we simply fixed the dependency. For 14.0, we use this workaround as a fix: if the recaptcha is not installed as not found in the list of services in odoo.__DEBUG__, then we make sure the newsletter popup work without it. In edit mode, we now also display a warning which allows to fix the issue directly (by installing recaptcha). closes odoo/odoo#65263 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-06-05[IMP] google_recaptcha, *: integrate recaptchaV3fja-odoo
* = base_setup, website_form, website_sale, website_crm, crm_iap_lead_website, website_hr_recruitment, website_mass_mailing Integrate reCaptchaV3 on website_form submit and website_mass_mailing subscription. You can now use ReCaptchaV3 to add reCaptcha verification in any module using google_recaptcha. Also added a better error management on the form with custom messages. task-2217980 closes odoo/odoo#48466 Related: odoo/enterprise#9649 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-07-17[REF] mass_mailing: rename mail.mass_mailing.{.contact{_rel}, list{.merge}} ↵Thibault Delavallée
models PURPOSE Mass mailing is currently a bit messy. As SMS will be added as a way to notify people in mass through SMS let us take this opportunity to somehow clean this application: organization, light code cleaning, model renaming. SPECIFICATIONS Rename mail.mass_mailing.list and mail.mass_mailing.list to mailing.list and mailing.list.merge. Rename mail.mass_mailing.contact to mailing.contact. Rename mail.mailing_list.list_contact_rel to mailing.contact.subscription. Rationale : * those new names are easier to understand: mailing.list and mailing.contact are less mail-related, especially taking into account that SMS will allow to be less mail-oriented; * those names are easier to read / find / understand; * align wizard and sub-models naming with the main naming; * have a mailing as first part of namespacing; MIGRATION mail.mass_mailing.list model -> mailing.list mail.mass_mailing.list.merge model -> mailing.list.merge mail.mass_mailing.contact model -> mailing.contact mail.mass_mailing.list_contact_rel model -> mailing.contact.subscription mail_mass_mailing_contact_list_rel table -> mailing_contact_list_rel (specific case of a decorated m2m) fields updated (no column change) * mailing.list: subscription_contact_ids -> subscription_ids LINKS Task ID 2037906 Preparing task ID 1997464 (SMS addition in mass mailing) PR #34938
2019-06-25[IMP] website_mass_mailing, *: improve newsletter snippetsKishan Gajjar
* website, mass_mailing, web_editor This commit adds various improvements in newsletter snippets as follow: - Improves UI for newsletter popup. - We only had one popup for all websites. Now, we can have a different popup for each website. - The popup was not appearing on mobile/tablet devices. Now, in mobile/tablet devices, the popup appears automatically after 5secs. - Added the ability to customize the whole editor popup like any editable area (background colors, etc). - User needed to enable popup snippet from the settings. We removed that setting so now popup snippet will always be available. - Added new snippet "Newsletter block". - Display notification after successful subscription the same way for all newsletter snippets. Closes https://github.com/odoo/odoo/pull/29353 task-1903256 closes odoo/odoo#29353 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com> Co-authored-by: qsm-odoo <qsm@odoo.com>
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>
2018-10-17[FIX] website_mass_mailing : Fix is subscriber to filter on opt_outDavid Beguin
since the opt_out per mailing list, to check if an email address is subscribed to a mailing list, this cannot be done at contact level but at the many2many contact-list level. Fix Task ID : 33224 closes odoo/odoo#27899
2018-08-10[IMP] mail, mass_mailing : apply blacklist, opt_out per mailing listDavid Beguin
Purpose ======= - Apply the blacklist implementation to Improve mailing subscription to be more compliant with the European GDPR law. Keep a list of people who does not want to receive promotional emails (or mass mailing in general) anymore. - Allows the recipient to update himself his mailing preferences Specifications =========== This commit is regrouping some main changes on mass mailing. Apply Blacklist for following models through blacklist.mixin : - crm.lead - res.partner - mail.mass_mailing.contact - mail.channel.partner - Opt_out per mailing list instead of per mailing contact. - Replace opt_out by blacklist in crm.lead + res.partner models - Added 'ignored' state for mass_mailing. Ignored = blacklisted, opted-out Ignored email are not included into final statistics to avoid confusion. - Unsubscribe(d) pages migrated from website_mass_mailing to mass_mailing module as thoses pages should work without having the website module installed Detailed implementation =================== Mass-mailing : - A blacklisted email is notified by the ban icon next to the email field. (at the left of the email field for display purpose) - Renaming the '_get_blacklist' method that was actually searching opt_out list into 'get_opt_out_list' - Opt out per mailing list : Add opt_out + related fields (for display and ergonomy reasons) on the relational model - Display relational model tree view instead of mass_mailing.contact tree view when clicking on mass_mailing_list in kanban view -> In order to be align between contact_nbr displayed in kanban tile and the content of the tree view -> mass_mailing contact is accesible via the user icon in this tree view - Remove custom filters 'filter_contact_subscription' and 'filter_contact_unsubscription' as opt_out is not on mass_mailing.contact model anymore - Add 'is_public' to mailing list The name of this mailing list can be seen (or not) by recipient in the unsubscription page If the mailing lists used in the mass mailing are not public, the user in only informed that he has been unsubscribed. If the mailing lists are public, the user is informed that he has been unsubscribed from the mailing lists and he has the choice to modify his subscription to all the public mailing list he is or was subscribed to. - Unsubscription Page : - mass_mailing_contact : Opt_out per mailing list, done by email and not by id, as multiple contact can have the same email The recipient can add/remove himself to/from the blacklist The recipient can send a feedback about why he unsubscribed - crm.lead + res.partner : Once the recipient unsubscribe, he is automatically blacklisted The recipient can 'Come back' and remove himself from the blacklist if he changes his mind - Show blacklist button parameter added in config : The idea is to enable/disable the fact that the recipient can add himself to the blacklist by showing or not the 'blacklist me' button Only applies for mass_mailing.contact. The recipient, once blacklisted, can always, no matter the value of this parameter, 'come back' and unblacklist himself crm.lead + res.partner : - Replace opt_out by blacklist in crm.lead + res.partner models. As when a res.partner or crm.lead unsubcribe, we assume that the recipient does not want to receive mass mailing anymore, at all, even if we adds him to a mailing list afterwards. He is then blacklisted to avoid this. With this behaviour, if a new lead is created with the same email address, he won't be able to receive mail in mass_mode. But he will still be able to receive '1 to 1' direct email. Task ID 33224 Closes #25966
2018-06-11[FIX] website_mass_mailing: Use the correct model to unsubscribeDavid
Purpose ======= When a contact in a mailing list receives a mass_mailing with an unsubscription link, then he is automatically unsubscribed once the unsubscription link in clicked instead of opening the unsubscription form. Specification ============= Now the user can decide wether to unsubscribe or not. Closes #24969
2017-09-15[IMP] mass_mailing: choose model among all chatter modelsYannick Tivisse
This commit removes the strange selection box based on a magic flag and some strange methods returning a string. Instead just allow to send mass mailing on all models inheriting from mail.thread using the is mail thread flag. Various addons are updated to remove the _mail_mass_mailing class attribute used to determine mass mailing capability. We consider people could send a mass mailing on every model inheriting from mail.thread. It makes no sense to limit it to a given set of addons.
2016-11-29[IMP] mass_mailing: better management of contacts listsFabien Pinckaers
2016-08-04[MIG] website_mass_mailing: Migrate to new APIXavier Morel
Half the controllers were already in the new API, migrated the rest.
2016-08-04[REF] website_*: remove `render` method on websiteJérome Maes
Since saas-3, website controllers use `request.website.render` to render the template of a web page. This was kept for retro compatibility. It's time to stop using deprecated stuff. Same for `_render` method on website. 'json' route don't use `request.render` since `JsonRequest` has no `render` method.
2016-06-17[MIG] mass_mailing: code migration to new apiKeyur Gajjar
NB: A controller in website_mass_mailing has been migrated too. It's not a real issue as this module will also be migrated in the days to come
2016-06-02[MERGE] forward port of branch saas-6 up to 589751cChristophe Simonis
2016-02-17[FIX] mass_mailing: unsubscribe route without websiteDenis Ledoux
The unsubscribe URL is used within the `mass_mailing` module, e.g. in `_get_unsubscribe_url` & `send_get_email_dict`. Basically, there is the possibility to add the unsubscription link in the mass mailings while having only `mass_mailing` installed. But, the unsubscription route is defined within the module `website_mass_mailing`. Therefore, if you added the unsubscription link within your mailings while not having `website_mass_mailing` installed, trying to follow the unsubscription link leaded to a `404 Not Found` page. We therefore define the route within `mass_mailing` directly, which does the basic stuff (the basic unsubscribe and confirmation), and override this route in `website_mass_mailing`, where the advanced stuff is done (the mailing lists list unsubscription and the better looking page). opw-669425
2015-11-25[MERGE] forward port of branch saas-6 up to dade7e3Christophe Simonis
2015-10-02[FIX] website_mass_mailing: unsuscribe to a mailing listMarkus Mattes
Fix the reference to the template 'website_mass_mailing.page_unsubscribed'
2015-07-10[IMP] mass_mailing: remove depends to website. Create a website_mass_mailing ↵Christophe Matthieu
bridge to add subscribe snippet into website builder. Split website_links to have link_tracker to create short and trackable URLs, and website_links to have a website layout for link_tracker and add button to share page.