artfulrobot / uk.artfulrobot.civicrm.gocardless

A CiviCRM extension providing GoCardless integration to handle UK Direct Debits.
GNU Affero General Public License v3.0
5 stars 18 forks source link

Enable sending of receipts #61

Closed wmortada closed 3 years ago

wmortada commented 4 years ago

Currently this extension disables the sending of receipts. I'm not quite sure of the rationale behind this particularly as this can be controlled per contribution page.

This is the relevant section of the code:

https://github.com/artfulrobot/uk.artfulrobot.civicrm.gocardless/blob/1.8/CRM/GoCardless/Page/Webhook.php#L202

As it says in the comment, if there is a requirement for receipts to be disabled it would be better to do this via a setting so that it can be turned on or off per site rather than hard-coded.

I'd be interested in hearing from others about whether they feel this is needed at all, if we should allow sites to control this via the setting on the contribution page or if we need a setting for this extension.

artfulrobot commented 4 years ago

(I updated the link to the 1.8 version of the code, master has moved on)

Yes, it would be good to sort that one out. There's 2 reasons for it:

  1. GoCardless itself is quite chatty with sending receipts directly, so we'd be sending people 2 emails each month. I think you can turn those off at GC (I'm not sure), though.

  2. Historically I didn't write this for CiviCRM's built in contribution forms, and I didn't want Civi sending receipts. The only way in CiviCRM to control these is via the Contribution Pages' config; there's nothing in the contribution or contribution recur tables that stores this preference. So if you don't have a contribution page, you need another place for that setting. The contributions are generated when GC sends a notification and the code to handle that is common to Core and bespoke uses.

So I probably need to find a place to inject a setting like:

  ☑ Send email receipts if there is no Contribution Page associated with a contribution

Then when one comes in:

PRs welcome.

wmortada commented 4 years ago

Thanks for the clarification (and fixing my link :-)). That helps to explain the rationale.

I believe that GoCardless only sends emails when a subscriber first sets up the mandate. They get one to confirm the mandate and one for the subscription. I don't think they get an email for each subsequent payment (at least that hasn't been my experience in testing it). So this means that subscribers are currently getting no emails for second and subsequent payments.

Your approach seems sensible and it would be good to have this as an option in the UI.

artfulrobot commented 4 years ago

Linking this https://lab.civicrm.org/dev/core/issues/1423 since fixing that would give a more CiviCRM-centered way to acheive it.

artfulrobot commented 4 years ago

Worth also noting that:

wmortada commented 4 years ago

Sounds like this should ideally be tackled in CiviCRM core first and then get this extension to plug in to this.