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]
''')