Email ================== .. py:data:: model.TestEmail :rtype: boolean Set this to True to cause all emails sent during the script to go to the currently logged in user's email.:: model.TestEmail = True .. py:data:: model.Transactional Prevents sending notices about emails having been sent:: model.Transactional = True .. py:function:: model.ContentForDate(file, date) :returns: The HTML content for a particular date ready to be used for an email. :rtype: str :param str file: The name of the HTML content :param date date: The date to search for the associated content. This function is for a very special purpose. Bellevue sends out a daily devotional email that people can subscribe to. The content for each day's email is stored in a large `Special Content > HTML` file. All the days are stored in the same file, separated by markers that indicate the start of a particular day. The day marker is contained in an ``

`` header and looks like::

2/27/2016==============================

content of email here... This function looks for that pattern ``

m/d/yyyy=======

``. Once it finds that for the date specified, it returns the rest of the content up until the next marker or end of file. .. py:function:: model.Email\*(query, queuedby, from, name, ...) :param str query: See :doc:`QueryParameter` :param int queuedby: The PeopleId of the coordinator's email address who is emailing on behalf of sender name :param str from: The from email address :param str name: The sender's name This is the pattern for all of the following functions. Each one takes these first four parameters and are different only in the remaining parameters beyond the first four. .. py:function:: model.Email(query, queuedby, from, name, subject, body, *cclist) :param str subject: The subject of the email (overrides the subject in the special content) :param str body: The message content of the email. :param str cclist: \*optional default=None. A comma separated list of email addresses. Sends an email to a list of people in a query passing in both subject and body of the email. .. py:function:: model.EmailContent(query, queuedby, from, name, file) :param str file: The name of the special content holding the message body and subject Sends an email to a list of people in a query based on saved content. .. py:function:: model.EmailContentWithSubject(query, queuedby, from, name, subject, file, *cclist) :param str subject: The subject of the email (overrides the subject in the special content) :param str file: The name of the special content holding the message body and subject :param str cclist: \*optional default=None. A comma separated list of email addresses. Sends an email to a list of people in a query based on saved content, but also allows you to specify subject. .. py:function:: model.EmailReminders(orgid) :param int orgid: The id of the Organization to email reminders for. This function will email reminders for an organization that utilizes them. If the organization is a `ChooseVolunteerTimes` type of organization, it will send volunteer reminders of those who are scheduled to work in the next 7 days. Otherwise, if the organization has an Online Registration and there is a `Reminder Email` setup on the Messages tab, then the reminders for the event will be sent. .. py:function:: model.EmailReport(query, queuedby, from, name, subject, report) :param str subject: The subject for the email. :param str report: The name of the Python script to run to get the body of the email. This is useful for sending a user generated statistics report periodically to leaders. .. py:function:: model.EmailReport(query, queuedby, from, name, subject, report, query2, query2title) :param str subject: The subject for the email. :param str report: The name of the Python script to run to get the body of the email. :param str query2: Another query which can be used inside the report script. :param str query2title: The title for the query to be run inside the report script. This is the same as previous, except that you can use the same script but pass in another query to generate custom content based on that passed query. The previous version of EmailReport required you to embed the query name in the Python script. This version of the function permits you to have a generic Python script and then call it multiple times with a different query and description each time. The query2 is available to the report script as `Data.QueryName`. The title of the query2 is available to the report script as `Data.QueryDescription`. .. py:function:: model.EmailStr(body) :param str body: The content of the email to be processed. This will process body through our EmailReplacements code. The person to be used to generate replacements will be the currently logged in user. This is useful for testing a script generated email to see how it will look.