CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Sending offline contribution receipt programmatically.
Pages: [1]

Author Topic: Sending offline contribution receipt programmatically.  (Read 1055 times)

erik.johansson

  • I’m new here
  • *
  • Posts: 4
  • Karma: 0
  • CiviCRM version: 4.2.4
  • CMS version: Drupal 7
  • MySQL version: 4
  • PHP version: 5
Sending offline contribution receipt programmatically.
March 11, 2014, 03:16:30 am
Hi, I've created a custom payment processor which I need to implement custom receipts to. I'need to send out an offline contribution receipt when a payment has been made but i don't want to manually go to the contribution and check the "send receipt" each time there is a new contribution. Does anybody know how to do this in code? The best would be if I could do it in my IPN file after setting the contribution as completed.

Kind regards, Erik.

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Sending offline contribution receipt programmatically.
March 13, 2014, 07:08:13 pm
There is a contribution.sendconfirmation api - but I think it defaults to online. I'm not sure I completely understand your request (how the payments are getting into the system, why you don't want people to check the box to send a receipt if required)
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

erik.johansson

  • I’m new here
  • *
  • Posts: 4
  • Karma: 0
  • CiviCRM version: 4.2.4
  • CMS version: Drupal 7
  • MySQL version: 4
  • PHP version: 5
Re: Sending offline contribution receipt programmatically.
March 14, 2014, 05:37:58 am
Basically I want to send the offline contribution receipt automatically when a contribution is set as completed. This is because the offline receipt contains tax information etc. Maybe I should reformulate myself. I want to add tax field to the receipt that is being sent when a new contribution has been added.
« Last Edit: March 14, 2014, 07:16:18 am by erik.johansson »

joanne

  • Administrator
  • Ask me questions
  • *****
  • Posts: 852
  • Karma: 83
  • CiviCRM version: 4.4.16
  • CMS version: Drupal 7
Re: Sending offline contribution receipt programmatically.
March 14, 2014, 03:12:28 pm
You say,
Quote from: erik.johansson on March 14, 2014, 05:37:58 am
when a new contribution has been added.

How is it it "added"?  Is it an online contribution entered by the contributor, or is it being processed offline via the UI by office staff, or are you importing a .csv file containing contributions received outside CiviCRM?

jaapjansma

  • I post frequently
  • ***
  • Posts: 247
  • Karma: 9
    • CiviCoop
  • CiviCRM version: 4.4.2
  • CMS version: Drupal 7
  • MySQL version: 5
  • PHP version: 5.4
Re: Sending offline contribution receipt programmatically.
March 24, 2014, 03:49:35 am
I am having a siimilair question. I want to create an 'official' invoice when a contribution is added. This invoice is a pdf with an invoice number, date, amount, tax, etc... All this data is available as custom fields on the contribution and the data is populated from the registration for an event, memberships and the accounting software e.g. the invoice number.

What I want to do, is to link a pdf to a contribution, and generate this pdf automatic. It is a pdf because it the pdf is printed and has the address on a location of the letter so that this address is visible in the envelop.
Developer at Edeveloper / CiviCoop

joanne

  • Administrator
  • Ask me questions
  • *****
  • Posts: 852
  • Karma: 83
  • CiviCRM version: 4.4.16
  • CMS version: Drupal 7
Re: Sending offline contribution receipt programmatically.
March 24, 2014, 05:54:33 am
As your invoices are going to be printed off and posted, do they need to be produced at exactly the same time as the contribution is "added"?  (Again I think "added" is too imprecise as what can be done easily for online and offline processing is different - I'll assume you mean both and answer accordingly)

If not, have you tried setting up the invoice as a message template? Each morning you would find all yesterday's contributions and select Thank-you Letter for contributions as your action, choosing your invoice message template.

You may need to do "something tricky" to get all the tokens you want to show, but perhaps not as you say they are contribution custom fields, not membership or event ones.

It isn't "automatic", but as you can print 100 or so invoices at a time it may suffice.

 
« Last Edit: March 24, 2014, 06:24:49 am by joanne »

jaapjansma

  • I post frequently
  • ***
  • Posts: 247
  • Karma: 9
    • CiviCoop
  • CiviCRM version: 4.4.2
  • CMS version: Drupal 7
  • MySQL version: 5
  • PHP version: 5.4
Re: Sending offline contribution receipt programmatically.
March 24, 2014, 06:26:44 am
Hey Joanne,

Yes I was already looking in the direction of message templates because when i say added. It is not realtime. But the next morning might be too late (however I might have to verify this with the end users). The workflow is probably that someone is registering participants to an event (those participants have registers theme selves offline). After they have finished the registration of the persons. Contributions are made from the registration (this we have customized already) after the end user thinks he/she is finished. And then later on the end user might create and send invoices.

Do you know which message template I have to use for the receipt/thank you letter? We really want a receipt/invoice a thank you letter is something else. But we can misuse the thank you letter functionality for invoicing but I would prefer the receipt functionality.
Developer at Edeveloper / CiviCoop

joanne

  • Administrator
  • Ask me questions
  • *****
  • Posts: 852
  • Karma: 83
  • CiviCRM version: 4.4.16
  • CMS version: Drupal 7
Re: Sending offline contribution receipt programmatically.
March 24, 2014, 08:13:16 am
You just create a new user-driven message template under mailings>message templates.

As part of the process for producing the Thank-you Letter for contributions you can choose between :

Update thank-you dates for these contributions and    
Update receipt dates for these contributions

If you select that latter, as far as the system is concerned you have sent a receipt/invoice - that is where the send date will be stored.

As far as the timing is concerned I suggested the next day as I was assuming some of the contributions could come in online late at night and it is easiest to find the contributions a calendar day at a time.

If it is all offline processing then the letters could be created as soon as the last back office processing was completed for that day, you wouldn't need to wait for the next day.  You could even print them individually after each contribution was recorded, but that involves a lot more clicks of the mouse - it is more efficient to do them in one batch.

jaapjansma

  • I post frequently
  • ***
  • Posts: 247
  • Karma: 9
    • CiviCoop
  • CiviCRM version: 4.4.2
  • CMS version: Drupal 7
  • MySQL version: 5
  • PHP version: 5.4
Re: Sending offline contribution receipt programmatically.
March 24, 2014, 08:31:23 am
Thanks
Developer at Edeveloper / CiviCoop

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Sending offline contribution receipt programmatically.

This forum was archived on 2017-11-26.