Page MenuHomePhabricator

Automatic DAF thank you email
Closed, ResolvedPublic2 Estimated Story Points

Description

Could we have an automatic thank you email that goes out when a Donor Advised Fund (gift source) contribution is saved as long as there is an email address? Right now, it needs to be done manually, but we just need the regular thank you email with tax information removed. This would result in our donors getting thanked much faster during high volume time and would make it much less cumbersome.

Event Timeline

This also ties in with the batch data entry task (T230450)

mepps set the point value for this task to 2.Sep 23 2019, 8:24 PM
mepps subscribed.

Hmm, we think this could be pulling the gift source and using and if conditional in the thank you letter.

Change 545121 had a related patch set uploaded (by Cstone; owner: Cstone):
[wikimedia/fundraising/crm@master] WIP: Add automatic thank you email when a Donor Advised Fund gift_source is saved.

https://gerrit.wikimedia.org/r/545121

@RLewis When you are entering DAF contributions are they all manually done in the Civi UI?

@Cstone yes they are entered manually either by Leanne for those that are $5k and over or Engage staff, they have started using the batch data entry to help efficiency for this process.

Change 545121 merged by jenkins-bot:
[wikimedia/fundraising/crm@master] Add new twig variable gift_source to thank you mail template.

https://gerrit.wikimedia.org/r/545121

I swept up the above commit in a deploy I just did but actually the table name was wrong -> failmail

Trying to push out https://gerrit.wikimedia.org/r/#/c/wikimedia/fundraising/crm/+/547366/ now

Thanks @Eileenmcnaughton for deploying and then quick fixing the wrong table name!

I just tested this on production, when a contribution's Gift Source is Donor Advised Fund and you remove the no thank you reason, an automatic thank you email will go out without the tax information.

@Cstone and @Eileenmcnaughton this is great news and is going to save us so much time going forward. Thank you!!

@Cstone and @Eileenmcnaughton Thanks so much for this! To confirm, is this live on production? Also, does this apply to contributions added on the contact record or the batch data entry page or both? Just want to make sure I give Engage the right info.

@LeanneS This is live on production. It applies to both the batch entry page and the contact record when the no thank you reason is cleared out (to trigger the thank you mail send).

@Cstone Awesome thanks! And on the contribution record, how does the thank you get triggered? I was able to generate this TY in Batch Data Entry, but wasn't able to trigger one manually on my own record.

@LeanneS You need to clear out the No Thank-You Reason under the Contibution Extra area. It gets set to Manually entered by default but if you delete that it will trigger the thank you email send when the contribution is saved.

@Cstone Thanks! I see now what the issue was now. I was clearing out the field, but then entering in a date under Thank-You Sent. It looks like if I enter in a date in the Thank-You Sent field, it doesn't send, but if I leave it blank, it will trigger the TY email.

@LeanneS oh good to know! Glad you were able to figure it out

@Cstone Same! And just to confirm, if there is no email address, the Thank-You Sent field will remain blank? We'll need to go back and pull those that didn't receive the automatic TY so that would be the easiest way to tell who still needs one.

@LeanneS yeah the Thank-You Sent will remain blank if there is no email address

Hi All, it looks like the automatic TYs haven't been going out. When I search for DAF gifts with email addresses, there are a few hundred that show with a status of "Thank-you Not Sent". The no thank you reason says "Manually entered."

@LeanneS - I'm just catching up on this but it looks like the comment says https://phabricator.wikimedia.org/T233374#5648173

You need to clear out the No Thank-You Reason under the Contibution Extra area. It gets set to Manually entered by default but if you delete that it will trigger the thank you email send when the contribution is saved.

I'm not quite sure on the data entry flow but perhaps we should dig into this in fortnightly

@Eileenmcnaughton Thanks for this info. Is there any way to take out the need to go back and delete Manually Entered and save? This would be a bit cumbersome for Engage especially when dealing with high volume and I'd love to make the process less manual.

@LeanneS in terms of updating these values & triggering emails - it looks like there is a smattering of old ones - do we just want to do Nov 2019-Jan 2020?

select YEAR(receive_date)as year, MONTH(receive_date) as month, count(*) as no_contributions FROM civicrm_contribution c LEFT JOIN civicrm_email e ON c.contact_id = e.contact_id AND e.is_primary = 1 LEFT JOIN wmf_contribution_extra w ON w.entity_id = c.id LEFT JOIN civicrm_value_1_gift_data_7 g ON g.entity_id = c.id WHERE no_thank_you = 'Manually Entered' AND campaign = 'Donor Advised Fund' AND email LIKE '%' AND thankyou_date IS NULL GROUP BY YEAR(receive_date), MONTH(receive_date) ;

yearmonthno_contributions
201886
201893
2018107
20181158
20181239
2019121
201925
201931
201941
201951
2019102
2019111
201912774
20201133

Change 565175 had a related patch set uploaded (by Eileen; owner: Eileen):
[wikimedia/fundraising/crm@master] Set no-thank-you-reason field to NULL for manually entered Donor-Advised-Fund donations who have emails.

https://gerrit.wikimedia.org/r/565175

Change 565175 merged by jenkins-bot:
[wikimedia/fundraising/crm@master] Set no-thank-you-reason field to NULL for manually entered Donor-Advised-Fund donations who have emails.

https://gerrit.wikimedia.org/r/565175

Code changes for this are deployed - I set the thank you mail date range up from 60 days to 73 temporarily & re-ran the job & this query

select YEAR(receive_date)as year, MONTH(receive_date) as month, count(*) as no_contributions, c.contact_id  FROM civicrm_contribution c LEFT JOIN civicrm_email e ON c.contact_id = e.contact_id AND e.is_primary = 1 LEFT JOIN wmf_contribution_extra w ON w.entity_id = c.id LEFT JOIN civicrm_value_1_gift_data_7 g ON g.entity_id = c.id WHERE  campaign = 'Donor Advised Fund' AND email LIKE '%' AND thankyou_date IS NULL AND c.contact_id <> 72 GROUP BY YEAR(receive_date), MONTH(receive_date)  ;

now shows no records more recent than Aug (which we left out of scope with a focus on Nov 19 +)

e.g of now sent mail
civicrm/contact/view?reset=1&cid=8108453

@LeanneS OK to close - if you enter DAF now it should clear the no thank you field by javascript to help not make mistakes going fowards

@Eileenmcnaughton Thanks, it looks like the emails are going out now!