send_welcome_email
Django management command to send a welcome email to an account user.
This module defines the send_welcome_email management command for the Smarter platform.
It allows administrators to send the HTML welcome email to a user
recorded in the AccountContact table, based on various identifying inputs.
Features
Sends an HTML welcome email to a target user of an account.
User can be located via username, email, account number, or company name.
Will create the AccountContact record if it does not already exist.
Command-line Options
--account_number: The Smarter account number to which the user belongs.--company_name: The company name to which the user belongs.--username: The username of the user.--email: The email address of the user.--language: The language of the email, one ofsettings.LANGUAGES, e.g.es. Defaults to the user’s preferred language (UserProfile.language), or English for a contact who isn’t a user.
Typical Usage
Used by administrators via manage.py send_welcome_email to send or re-send
the welcome email to new or existing users for onboarding or support purposes.
- class smarter.apps.account.management.commands.send_welcome_email.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]
Bases:
SmarterCommandSend the html welcome email to a user in the AccountContact table.
- get_user_profile(description, **lookup)[source]
Return the one user profile that matches
lookup.- Parameters:
description (
str) – how the user was identified, for the error message, e.g.username jdoe.lookup – the
UserProfilequery, e.g.user__email="jdoe@example.com".
- Return type:
- Returns:
the user profile.
- Raises:
CommandError – if no user profile, or more than one, matches.