Faith Path Stage of Life Campaign

This recipe will allow you to send age appropriate emails to a child’s parents on the child’s birthday. The script will run each morning at 4:30 (CT) as part of the MorningBatch, finding those indicated in the search criteria and emailing the parents. The content should provide stage of life resources with perhaps a video from the pastor, links to resources, etc.

This recipe has 13 different emails as you see listed below. All but 2 are sent on the child’s birthday. The top 2 in the list are sent the day after a new people record is created for a child 2 or under and for a new record created for a child age 3 to 18.

Follow the steps below to create your own Faith Path Campaign. This one was based on the Home Point recommendations.

Step 1 - Emails

Create each email message in Special Content > Html Content giving each one a different Name, without any spaces (use CamelCasing).

The Title of the content will be the Subject of the email when it is sent.

This list matches the Python code and serves as a guide to make it easier for you to create your email content. See below for a sample email from one of our TouchPoint churches.

Name of Email Content

When to Send

FaithPath-Birth-2yrs

recently created records

FaithPath-Overview-3-18yrs

recently created records

FaithPath-Blessing-3yrs

on 3rd birthday

FaithPath-FamilyTime-4yrs

on 4th birthday

FaithPath-LeadChildtoChrist-5yrs

on 5th birthday

FaithPath-Prayer-6yrs

on 6th birthday

FaithPath-Bible-7yrs

on 7th birthday

FaithPath-Worship-8yrs

on 8th birthday

FaithPath-GivingServing-9yrs

on 9th birthday

FaithPath-Adolescence-11yrs

on 11th birthday

FaithPath-Purity-13yrs

on 13th birthday

FaithPath-RiteofPassage-16yrs

on 16th birthday

FaithPath-Launch-17yrs

on 17th birthday

Step 3 - Create Python Script

Select and copy all of the code below. Then go to Special Content > Python Scripts and click the New Python Script File button. Name the file FaithPathEmails.

Paste the code you copied from this document into the script and save the changes.

Step 4 - MorningBatch

Create a new Python script named MorningBatch or edit your existing one. Add the following line:

model.CallScript ('FaithPathEmails')

Note

If you name your Python Script something other than FaithPathEmails you must use that name in the line of code above. These names must match.

Step 4 - Edit Python Script

Replace the following:

  • queuedby - enter the PID# of the person managing the emails (sending ‘on behalf of’)

  • fromemail - enter (between quotes) the email address of the person sending the email

  • fromname - enter (between quotes) the name of the person sending the email

Now review the search criteria in the script and make any changes that are necessary and save the script.

Search Criteria

The criteria in the code will first find the child based on the age indicated, then add the condition Parents Of (to send to the parents, not the child), and then will add the conditions at the top of the script. Those conditions exclude Previous Members and anyone with one of the flags set - do not call, visit, or mail.

Sample Email with a Video Embedded

https://i.tpsdb.com/2017-05-08_16-04-17.png

Code for Python Script

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
queuedby = 1234
fromemail = 'pastor@mychurch.org'
fromname = 'John Anderson'

def SendEmail(content, query):
    model.EmailContent(query + '''
        AND MemberStatusId <> 40[Previous Member]
        AND DoNotCallFlag <> 1[True]
        AND DoNotVisitFlag <> 1[True]
        AND DoNotMailFlag <> 1[True]
''', queuedby, fromemail, fromname, content)

# Send email to recently created records
SendEmail("FaithPath-Birth-2yrs", '''
    Age <> ''
    Age <= 2
    AND RecentCreated( Days=1 ) = 1[True]
    AND ParentsOf = 1[True]
''')
SendEmail("FaithPath-Overview-3-18yrs", '''
    Age > 2
    AND Age <= 18
    AND RecentCreated( Days=1 ) = 1[True]
    AND ParentsOf = 1[True]
''')

# send these on their birthday
SendEmail("FaithPath-Blessing-3yrs", '''
    Age = 3
    AND DaysTillBirthday = 0
    AND ParentsOf = 1[True]
''')
SendEmail("FaithPath-FamilyTime-4yrs", '''
    Age = 4
    AND DaysTillBirthday = 0
    AND ParentsOf = 1[True]
''')
SendEmail("FaithPath-LeadChildtoChrist-5yrs", '''
    Age = 5
    AND DaysTillBirthday = 0
    AND ParentsOf = 1[True]
''')
SendEmail("FaithPath-Prayer-6yrs", '''
    Age = 6
    AND DaysTillBirthday = 0
    AND ParentsOf = 1[True]
''')
SendEmail("FaithPath-Bible-7yrs", '''
    Age = 7
    AND DaysTillBirthday = 0
    AND ParentsOf = 1[True]
''')
SendEmail("FaithPath-Worship-8yrs", '''
    Age = 8
    AND DaysTillBirthday = 0
    AND ParentsOf = 1[True]
''')
SendEmail("FaithPath-GivingServing-9yrs", '''
    Age = 9
    AND DaysTillBirthday = 0
    AND ParentsOf = 1[True]
''')
SendEmail("FaithPath-Adolescence-11yrs", '''
    Age = 11
    AND DaysTillBirthday = 0
    AND ParentsOf = 1[True]
''')
SendEmail("FaithPath-Purity-13yrs", '''
    Age = 13
    AND DaysTillBirthday = 0
    AND ParentsOf = 1[True]
''')
SendEmail("FaithPath-RiteofPassage-16yrs", '''
    Age = 16
    AND DaysTillBirthday = 0
    AND ParentsOf = 1[True]
''')
SendEmail("FaithPath-Launch-17yrs", '''
    Age = 17
    AND DaysTillBirthday = 0
    AND ParentsOf = 1[True]
''')


Latest Update

11/13/2020

Modify image link with secure protocol.