Package: django-multimail
Django Multimail Requires Django 1.4+=====================================The django-multimail demo site is at: http://www.django-multimail.commultimail is a simple Django application that provides multiple-email addressfunctionality for Django's existing User model. Features include:* Auto-creation of a multimail email from the email on a User object* Email verification via link sent to new email address* Auto-deletion of unverified email addresses when a user is administrativelydeactivated.DJANGO COMPATIBILITY NOTE=========================django-multimail is tested against Django versions 1.4, 1.5, 1.6, and 1.7.Please report any known issues with any of these Django versions.CHANGELOG=========0.1.3-----Breaks Django 1.3 Compatability. django-multimail is now compatible withDjango 1.4+.TESTING=======To run the test suite:$ demo/manage.py testQUICKSTART==========If you already have email sending configured and Sites configured. (Seedetailed setup for alternatives to configuring Sites)* pip install django-multimail* add multimail to installed apps* include 'django.template.loaders.eggs.Loader' in your TEMPLATE_LOADERS* In your base urls.py:(r'^mail/', include('multimail.urls')),* syncdbDETAILED START==============* Configure your project for sending email. This usually involves settingthe following properties in your settings file: EMAIL_HOST, EMAIL_HOST_USER,EMAIL_HOST_PASSWORD, EMAIL_USE_TLS, EMAIL_BACKEND.  (See the Django docs:https://docs.djangoproject.com/en/1.7/topics/email/).  Additionally, youwill need to set either MULTIMAIL_FROM_EMAIL_ADDRESS or ADMIN_EMAIL forMultimail to use as the from mail address. ADMIN_EMAIL is used ifMULTIMAIL_FROM_EMAIL_ADDRESS has not been set.* Be sure you are setup to use Django's sites framework (see the Djangodocs: https://docs.djangoproject.com/en/1.7/ref/contrib/sites/).multimail uses the current domain to build verification link URLs.Alternatively, you can set the MULTIMAIL_EMAIL_VERIFICATION_URL settingsproperty. See the SETTINGS section below. Another option is to set boththe MULTIMAIL_SITE_DOMAIN, and MULTIMAIL_SITE_NAME. When both of theseare set, they will override the configured site settings (for multimailpurposes only).* Use of the messages framework is now optional. To use messages, setMULTIMAL_USE_MESSAGES to True. Be sure you are exposing messages in yourtemplates. See Django docs on the messages framework:https://docs.djangoproject.com/en/1.7/ref/contrib/messages/* Be sure to include 'django.template.loaders.eggs.Loader' in theTEMPLATE_LOADERS in your settings file. You should put this after loadersthat load templates you create yourself so that you can create overridingtemplates to replace the builtin multimail templates.* To install: pip install django-multimailOr, to install from source:pip install git+git@github.com:scott2b/django-multimail.git#egg=multimailor, download the code and run python setup.py install* Add multimail to your installed apps in your settings file* In your base url config, add a line like the following:(r'^mail/', include('multimail.urls')),The path name 'mail' is arbitrary and can be set to whatever you choose.* Run syncdbYou can now start creating new EmailAddress objects for your users. AVerification email will be sent automatically when a new EmailAddress object iscreated.EXAMPLE=======>>> from django.contrib.auth.models import User>>> u = User.objects.all()[0]>>> u.save() # will automatically create an EmailAddress object for the user's current email addressYou can also create EmailAddress objects for users directly:>>> from multimail.models import EmailAddress>>> addr = EmailAddress.objects.create(email='user@example.com', user=u)SETTINGS========The following properties may be set to customize your multimail installation.Note that where default properties are enclosed with _() indicates translationvia Django's ugettext. Multimail does not currently have any built-intranslations for its default messages. See the Django docs for informationabout creating translation messages: https://docs.djangoproject.com/en/1.7/topics/i18n/translation/#how-to-create-language-filesMULTIMAIL_ALLOW_VERIFICATION_OF_INACTIVE_ACCOUNTSDefault: False. Whether to allow users to verify emails associatedwith a deactivated account.MULTIMAIL_DELETE_PRIMARYDefault: False. Whether to clear the email field on the user objectwhen the last EmailAddress is deleted.MULTIMAIL_VERIFICATION_LINK_SENT_MESSAGEDefault: _("A verification link has been sent to %(email)s")MULTIMAIL_FROM_EMAIL_ADDRESSDefault: None, but falls back to ADMIN_EMAIL if not availableMULTIMAIL_EMAIL_ALREADY_VERIFIED_MESSAGEDefault: _("This email address has already been verified.")MULTIMAIL_EMAIL_VERIFIED_MESSAGE **(See note below)Default: _("Thank you for verifying your email address.")MULTIMAIL_EMAIL_VERIFICATION_URL **(See note below)Default: 'http://%(current_site_domain)s/mail/verify/%(emailaddress_id)s/%(verif_key)s'Notes: if you change this URL and/or the URL configuration for callingthe Verify view, you need to be sure that you are passing theemailaddress id, and the verification key into the view call.Current site domain is generally acquired from the Sitesconfiguration, but can be overridden by setting BOTH theMULTIMAIL_SITE_DOMAIN and the MULTIMAIL_SITE_NAMEMULTIMAIL_INACTIVE_ACCOUNT_MESSAGEDefault: _("The account associated with this email address has been marked as inactive. Please contact the site administrator.")MULTIMAIL_INVALID_VERIFICATION_LINK_MESSAGEDefault: _("The seleted email verification link is invalid. Please re-register your email address.")MULTIMAIL_POST_VERIFY_URLDefault: '/'MULTIMAIL_USE_MESSAGESDefault: False. Set to True to enable messages using Django'smessages framework.MULTIMAIL_VERIFICATION_EMAIL_SUBJECT **(See note below)Default:  _('Verfication required')MULTIMAIL_VERIFICATION_EMAIL_HTML_TEMPLATEDefault: 'multimail/verification_email.html'MULTIMAIL_VERIFICATION_EMAIL_TEXT_TEMPLATEDefault: 'multimail/verification_email.txt'**NOTE: properties marked with ** receive a context dictionary for stringtemplating. The default values do not take advantage of this, preferringstatic strings in order to take advantage of translation capabilities. Thefollowing keys are passed to these strings:current_site_domaincurrent_site_idcurrent_site_nameemailaddress_idemail (the email on the current multimail email object)first_namelast_nameprimary_email (the email on the user object)user_idusernameverif_keyverify_linkNote that MULTIMAIL_EMAIL_VERIFICATION_URL does not get the verif_link keyfor security reasons.MULTIMAIL_FROM_EMAIL_ADDRESSDefaults to using the ADMIN_EMAILMULTIMAIL_SEND_EMAIL_ON_USER_SAVE_SIGNALDefault: True. Affects the behavior of notifications when an email addressis created as a result of a user save. Multimail ensures that there isa multimail version of the email on the user object (which is consideredto be the primary email address for the user). If a user save resultsin the creation of a new EmailAddress object, the default behavior is tosend a verification link for that new address. Set this to False toturn off that behavior.MULTIMAIL_USER_DEACTIVATION_HANDLER_ONDefault: False. The old default was to cleanup any lingering, unverifiedemail addresses on user save. This can be a nuisance if your user objectsare getting modified and saved before users have the opportunity toverify their email address. If you know for sure that you do not needto save users between the time it takes to send a verification linkand the user clicking the link, then it is probably safe to set this toTrue for automated cleanup of lingering unverified emails. Otherwise, itis probably best to delete unverified emails manually.I am open to suggestions as to how to better handle automated cleanup oflingering unverified email addresses.MULTIMAIL_EMAIL_ADMINSDefault: True. Multimail may send notification emails to the site adminfor some errors that occur. Set this to False to disable those emails.MULTIMAIL_SITE_DOMAINDefault: None. Set to override the site domain for use in multimailtemplates and template strings. Requires both this and MULTIMAIL_SITE_NAMEto be set to non-None values.MULTIMAIL_SITE_NAMEDefault: None. Set to override the site name for use in multimailtemplates and template strings. Requires both this andMULTIMAIL_SITE_DOMAIN to be set to non-None values.MULTIMAIL_SET_AS_PRIMARY_REDIRECTDefault: 'profile'. Reverse name to redirect to after a call to thebuilt-in set-as-primary view. Defaults to 'profile'. Currently does nothandle passing of parameters -- if your user profiles require parameters(such as the username or user pk) then you will need to implement your ownview for handling a set-as-primary request. For details, seemultimail.views.set_as_primary in the source code.MULTIMAIL_ALLOW_REMOVE_LAST_VERIFIED_EMAILDefault: False. Whether to allow the user to delete all verifiedemails.MULTIMAIL_REMOVE_LAST_VERIFIED_EMAIL_ATTEMPT_MSGDefault: "Cannot remove last verified email. Add another verified emailaddress to remove the existing one." Message sent when user triesto delete the last verified email. Only ifMULTIMAIL_ALLOW_REMOVE_LAST_VERIFIED_EMAIL is False.