Marking this as done could-be-better since in an ideal world (which may not
exist) we would remove the hard-coded database ID from OneClickDonate.php. But
really there isn't any harm in leaving it there for now. The ID is not likely
to change even after upgrades and for now it gives us a tiny bit more security
that a receipt will be sent out under every possible circumstance during this
campaign.
Just to be sure, we shouldn't be relying on receipt_date for anything.
If we need to know when a donation was made we should be using the
receive_date field.
The only impact of a request to OneClickDonate.php without a receipt=
variable is that no receipt will be sent, which isn't a huge deal
since we can easily identify those contributions and then use the
script I wrote to send receipts.
I guess there is no real harm in leaving the default receipt template
ID in OneClickDonate.php ... something just feels wrong about
hardcoding auto-incremented database IDs.
I *think* so, but I wouldn't rush to do it. I would prefer that we be very
thoughtful and methodical about making sure that all of our links have an
explicit receipt ID, since not having a receipt date can impact other things.
Oh, wait. Setting this back to chatting. As far as everyone is concerned am I
safe to remove the hard-coded default template ID from the OneClickDonate.php
script?
Added receipt variable to Choose Your Own Amount, PCPs, and "Join the CC
Network" page.
Since there wasn't any request to use amount-specific receipts, I didn't modify
the JS, only the querystrings that get sent to it. We can revisit if this need
arises.
OneClickDonate.php now supports receiving a variable named "receipt." This
variable will define the database ID of the receipt message template to use when
the system goes to send a thank-you and receipt message to a donor when a
contribution is processed. Since we don't want to hard-code database IDs
anywhere, this variable needs to be made standard and required with each call to
OneClickDonate.php. One this is implemented, I will remove the hard-coded ID
from the OneClickScript.php script and if receipt is ever missing the the donor
simply won't get an email.