summaryrefslogtreecommitdiff
path: root/addons/mass_mailing/controllers/main.py
AgeCommit message (Collapse)Author
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.
2019-01-14[REF] link_tracker: do not let public read technical / private link dataThibault Delavallée
Link tracker models are rather technical and should not be accessed as it is by external people. Let us delegate control to controllers and lessen a bit model accessibility. Currently everyone can use add_click method and generate statistics. Now statistics will be generated only through dedicated routes. It will make statistics more reliable and ensure technical data remain private. Next commit will update code from controllers and main methods in order to be have a more readable click API and avoid link between non dependent modules. This commit is linked to task ID 1904277 and PR #28242.
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-10-26[IMP] mass_mailing: warn when unsubscribinggla
Current behavior before PR: When a lead or res.partner click in the 'unsubscribe' link in a mail that was sent to him via the mass mailing module (not via a particular mailing list), he is blacklisted from the whole mass mailing system. The only message he gets is "you have been successfully unsubscribed". Desired behavior after PR is merged: The user is told that he was unsubscribed, but in addition a warning is displayed telling him explicitly : - to which mailing lists he was subscribed - that he won't receive any mail from them anymore. Purpose : Warn the user that unsubscribe via a lead or res.partner mass mailing that he won't receive any mail from the mailing lists (listed in the warning) he had subscribed, if any. closes odoo/odoo#27678
2018-09-29[FIX] mail: fix blacklist mechanismOlivier Dony
Several quick fixes: - repair malformed SQL queries and injection problems - proper token comparisons (consteq) - better translatable terms (less context-lessplaceholders) - basic testing of case-(in)sensitivity of blacklist - safety check for non-implemented cases in search methods for computed field More testing and review is needed for case-sensitivity and email extraction from generic "addressing fields".
2018-08-30[FIX] mail, mass_mailing: remove user error if remove unexisting record from ↵David Beguin
blacklist In unsubscribe page, if the user try to come back (and be removed from the blacklist) but his email have been deleted from the blacklist, it was leading to an error. Instead, and in order to keep a trace of what the user asked, if the email is not found in the blacklist, the record will be created but archived directly. Also, it aligns the return of both methods _add/_remove
2018-08-30[IMP] mass_mailing : review unsubscribe page + renaming blacklist creation ↵David Beguin
date in form Reviewing unsubscribe page style and button naming. Rewritting the feedback controller to be easily readable. Renaming blacklist creation date field in form to remove confusion.
2018-08-29[FIX] mass_mailing: Feedback when multiple contacts with same email addressDavid Beguin
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-05-25[FIX] mass_mailing: have unsubscribe in multi langNicolas Lempereur
Since 953a693df link not corresponding to a route are tought multilang by default. Thus in the mass mailing, if the user had not the default language on the website he would have eg. a /fr_FR/unsubscribe_from_list placeholder in the mail. The placeholder is replaced by a real link pinpointing to the items the given person would unsubscribe to, but having /fr_FR/ part prevented that. With this PR, there is a dummy route so /unsubscribe_from_list is explicitely known as not multilang. opw-1850696 closes #24912 Co-authored-by: Goffin Simon <sig@odoo.com>
2017-10-20[MERGE] forward port branch saas-16 up to dc2a6c6cd2aChristophe Simonis
2017-10-13[FIX] mass_mailing: unsubscribe error if contactsNicolas Lempereur
If the mass mailing was to mail contacts, this could cause an error if the recipient unsubscribed. If the mass mailing was to mailing list, unsubscribe would not work. This change update unsubscribe to take into account changes in 765e752 and e15372c07 that allowed mailing list / mailing list contacts to be used separately. opw-770473 closes #20145
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.
2017-08-20[FIX] P3: fix base64 and StringIO usesXavier Morel
* StringIO removed from stdlib, replace with io * try to correctly handle BytesIO/StringIO (one is for bytes the other is for text) * fix base64: Python 3 removed bytes-encoding and bytes-bytes codecs (via #encode) so replace all calls to str.encode('base64'), also b64encode is a bytes->bytes conversion so attempt to properly handle that issue #8530
2017-03-07[FIX] mass_mailing: use consistent types for unsub token checkOlivier Dony
Passlib's consteq() function only works when both values are of the same type. `_unsubscribe_token` uses hmac.hexdigest() which always returns byte-strings, so we need to ensure that the token passed in GET parameters is cast to byte-string too. In addition, _unsubscribe_token() is expected to always derive the same token for the same list, res_id and email. It already takes care of ID passed as strings/int, but failed to make sure that the email can be passed as a byte-string or unicode-string. Forcing it to unicode before deriving the token takes care of that.
2017-03-07[FIX] mass_mailing: correct unsubscribe token checkOlivier Dony
The mailing._unsubscribe_token() method expected the record ID as an integer, but accepted strings and generated a different token for the string representation of an integer (!) The unsubscribe controller was passing a string by mistake. mailing._unsubscribe_token will still expect integers but if the string representation of an integer is passed it will be silently cast to an integer, and will generate the same token.
2016-11-14[IMP] mass_mailing: add security token to unsubscription URLJairo Llopis
Should prevent rogue unsubscriptions without making the process more complicated for legit cases. Closes #12040
2016-09-29[FIX] mass_mailing: restore py import (prevented to unsubscribe)qsm-odoo
For unknown reasons, commit bbca13541053a3ac35ac2ec340b843205117468a removed the import of "_" which was still used. This commit restores it, allowing users to unsubscribe from mailing without crash.
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-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-12-29[FIX] mass_mailing: don't assume the request will have a geoipJoren Van Onder
geoip is set by the website module. If website is not installed, request.session.geoip won't exist. Because all the geoip logic is in the website module this means that if you don't install the website module all of your tracked links will have an undefined country. This isn't that big of an issue, because as far as I can tell the only default view that displays this country is in website_links. Ideally, the geoip should perhaps be moved to base, but for now this will do.
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.
2015-07-10[IMP] mass_mailing: move code from website_mail to mass_mailing and use ↵Christophe Matthieu
web_editor
2015-02-18[ADD] mass_mailing: added bounce exchange bannerMahendra barad
2015-02-12[IMP] website_mail: improved template designer, added support for background ↵Christophe Matthieu
color, font color and convert class to inline style in mail designer, changed snippet according to new format, added theme selector in mail_designer, added font-awesome support (convert in image) in mail snippets
2015-01-07[IMP] Mass mailings send in cronJulien De Coster
1. The merge of the "email_template" module into the "mail" module. 2. The send action of the mass mailing has been moved from the frontend to a cron, because it was too slow to send over 10,000 mails (the user's browser was blocked for 15 - 20 minutes). Mass mailings have now their own process in the kanban view. 3. Mails sent from the mail form are sent immediatly instead of from the mail queue (for instance, when you go to sales > customers > list view > select 2 -3 customers > More > Partner Mass Mailing). 4. Users have now the choice from which mailing list they want to unsubscribe when they click on the unsubscribe link at the bottom of the mail. 5. Mass mailings inherit from their campaign UTMs and mass mailing campaigns are linked to an UTM campaign. 6. Many little improvements
2014-12-17[ADD] Add the website_links module.Julien De Coster
This module tracks clicks in mass mailing mails and allow the generation of trackable links in a website interface. Modules modifications --------------------- Refractoring of the crm_tracking_* classes in a new module. * Extract the crm_tracking_* from the crm module into a new module "utm" * Remove the crm_mass_mailing bridge module * New dependencies of mass_mailing and website_links to utm.
2014-11-04[IMP] use model._fields instead of model._all_columns to cover all fieldsRaphael Collet
The old-api model._all_columns contains information about model._columns and inherited columns. This dictionary is missing new-api computed non-stored fields, and the new field objects provide a more readable api... This commit contains the following changes: - adapt several methods of BaseModel to use fields instead of columns and _all_columns - copy all semantic-free attributes of related fields from their source - add attribute 'group_operator' on integer and float fields - base, base_action_rule, crm, edi, hr, mail, mass_mailing, pad, payment_acquirer, share, website, website_crm, website_mail: simply use _fields instead of _all_columns - base, decimal_precision, website: adapt qweb rendering methods to use fields instead of columns
2014-08-01[FIX] mass_mailing: possibility to subscribe again to a mailing listDenis Ledoux
It was not possible to subscribe again to a mailing list once unsubscribed
2014-08-01[MERGE] Forward-port saas-4 up to 8b15482Olivier Dony
2014-08-01[FIX] mass_mailing: allow to add a user/email to a specific mailing list and ↵Jeremy Kersten
not always the last as previously.
2014-06-03[FIX] mass_mailing: newsletter snippet:Thibault Delavallée
- fixed subscription, was always subscribing to the last created list; - slightly improved the snippet display, now displaying a 'thanks' when subscribed instead of just making everything disabled; - removed unnecessary JS line
2014-05-12[FIX] mass_mailing,website*,survey: leftover calls to website.get_public_user()Olivier Dony
This method was (partially) removed at rev.9421 rev-id al@openerp.com-20140507153223-q73u5lhyrfw98o3a bzr revid: odo@openerp.com-20140512103935-o0ue9wzenm5wjejq
2014-05-06[ADD] mass_mailing: add a snippet to allow subscribing to a contact list ↵Thibault Delavallée
(newsletter) bzr revid: tde@openerp.com-20140506145145-qvncr41sdmplc0bp
2014-04-24[FIX] mass_mailing: avoid using werkzeug API only present in 0.9+Olivier Dony
bzr revid: odo@openerp.com-20140424131451-rhtokro13piol7ji
2014-04-16[IMP] mail, mass_mailing: using a _mail_mass_mailing class attributeThibault Delavallée
it is now possible to compute models allowing mass mailing using mass_mailing_campaign module. This allows to completely remove the bridges modules, using a more generic controller for unsubscription. bzr revid: tde@openerp.com-20140416082851-8duo6yrwr5hwd8c2
2014-03-28[FIX] mass_mailing: make the tracking controller effectively return an image -_-Thibault Delavallée
bzr revid: tde@openerp.com-20140328132007-jbcmxcu9g35ct7gk
2014-03-25[IMP] mass_mailing: cleaned and fixed mass mailing.send_all + added an onverrideThibault Delavallée
of the controller to be able to unsubscribe from leads. bzr revid: tde@openerp.com-20140325154114-er4o489y3w3ng10f
2014-03-21[IMP] mass_mailing: improved send_mail method (WIP). Also addedThibault Delavallée
first fradt of adding an unsubscribe link in the sent emails. Added a controller managing this unsubscription. It is based on model, res_id and mailing_id, allowing to find the customer / lead / contact; but the email is added in the link to avoid allowing people unsubscribing random people using res_id generation. bzr revid: tde@openerp.com-20140321172139-sak10zs2g31xj0t4
2014-01-30[REM] remove disable_db and ensure_db() from addonsFabien Meghazi
bzr revid: fme@openerp.com-20140130092308-s24a7h2mhzuaasf1
2014-01-29[REM] Removed auth='admin' from modulesFabien Meghazi
bzr revid: fme@openerp.com-20140129171520-wkz8ot4pa63utoi3
2013-10-22import cleanups part1Antony Lesuisse
bzr revid: al@openerp.com-20131022170659-kg9err029ha22evh
2013-09-16[FIX] mass_mailing: Thibault Delavallée
- fixed forgottent import of mail_thread in mass_mailing, to enable bounce and replied tracking - fixed replied computation in message_route_process, adding the original email in parameters - fixed form view of campaign, to add edit and dlete now that clicking on it redirects to the waves - added track field on mail_mail, to avoid creating too mush entries in mail.mail.statistics - fixed mass_mailign controller bzr revid: tde@openerp.com-20130916114706-b9zyhp0ha6mr9fzg
2013-09-13[REF] mass_mailing: first refactorThibault Delavallée
Mail statistics are now stored onto a separated object (mail.mail.statistics), allowing to handle emails separately from statistics (among other removing mail.mail entries while keeping statistics). Everything linnked to opened/replied/bounce is not managed by mass_mailing, removed added code in mail module. bzr revid: tde@openerp.com-20130913115408-322cyjipdg680as6