You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
raiseUserError(rec.name+" has multiple entries in the mailing contacts.\nPlease clean things up and get back here after having removed the duplicates.")
eliflen(existing_contacts) ==1:
forrecipientinexisting_contacts: # should get exactly 1 recipient
list_ids= [listid.idforlistidinrecipient.list_ids] # get all the lists the user is subscribed to
iftarget_list_idinlist_ids:
raiseUserError(rec.name+" ("+rec.email+") already receives the newsletter.")
else:
recipient.write({ # add the newsletter to the list of subscription