Support

Home Forums Event Espresso Premium Use receipt template for event specific documents

Use receipt template for event specific documents

Posted: May 7, 2018 at 6:02 am

Viewing 8 reply threads


motio

May 7, 2018 at 6:02 am

Hi,

at the beginning of our courses we send to our instructors documents of that event (e.g. list of all attendees). Right now we export the data via csv report and use that in MS Word with the series letter function.

What I would like to achieve is to use the html receipt for the event documents and let the instructor download the documents on a private page through a event list (e.g. use the events table template (add-on) and change the link to the download link).

My approach to that would be the following:

I create an additional receipt for the event documents in EE. This receipt has a specific GRP_ID.

Than I would use the following url structure for the link of the event documents.

?ee=msg_url_trigger&snd_msgr=html&gen_msgr=html&message_type=receipt&context=purchaser&token=TOKENOFREGISTRANT&GRP_ID=20&id=31

For the token I would use the token of the first registrant of the event and then change the GRP_ID to the receipt ID of the event documents. That way the instructor should get the events documents by pressing on the link.

Through custom shortcode I could load data into events documents that I need.

This way other people in my team could make small changes through EE.

My question is, if that is a good approach or do you have better idea to accomplish that goal? Is there are downfall to that approach, that I don’t see?


Josh

  • Support Staff

May 9, 2018 at 11:53 am

Using custom fields and displaying the information to authorized users on the event page might be a better approach.

Here’s a tutorial that shows how to display custom fields on the event page:

https://eventespresso.com/wiki/add-sponsors-section-events-using-advanced-custom-fields/


motio

May 9, 2018 at 1:09 pm

Hey Josh,
thank you for the information, this could be useful for another case.

Right now I have to print every event documents (3-4 pages) and send it to the instructor. Every Instructor has 3-7 events every 3 month. The printout is mandatory. In my approach I am trying to optimize the workflow and save time.
The link in the table list view is a great way to be able print it out myself and have a good overview but filter the list that the instructor is seeing his/her events. So in the future the instructor can download and print it himself.

The only downside I see is that a registrant could open the “events documents” by editing the GRP_ID in the url. But I think that is unlikely.

Can you think of an other downside to use the receipt for this case?


Josh

  • Support Staff

May 9, 2018 at 1:17 pm

I’m afraid I don’t understand what you’re doing to be able to give it much thought.


motio

May 9, 2018 at 2:02 pm

hey josh, if I may I will try it again. Maybe I go through the steps.

1. Create a new html receipt in the backend of EE, that has a specific message GRP_ID (the pdf I want the instructor to have, which the instructor needs to give the course)
2. I create the table view espresso-events-table-template-for-instructors.template.php
3. I insert the [ESPRESSO_EVENTS_TABLE_TEMPLATE template_file=espresso-events-table-template-for-instructors.template.php] shortcode on a password protected page
4. I add a link to the table in the file espresso-events-table-template-for-instructors.template.php
The link has the following structure:

mysite.com?ee=msg_url_trigger&snd_msgr=html&gen_msgr=html&message_type=receipt&context=purchaser&token=TOKENOFREGISTRANT&GRP_ID=23

I take the token from the first attendee in the event and insert the token in the above field after “token=”, because the link don’t work without a token. The token of the registrant is only needed to get the event data for the receipt.
5. The link mentioned in step 4 has the GRP_ID of the html receipt mentioned in step 1
6. By clicking on the link on the event list, an html receipt will open, that I can save as a pdf, print it out and send it via mail (postal service) to the instructor.
7. The next step in the future would be: Filtering the events-table-template file (from step 2) for every instructor, that the instructor see only his event, and can download and print out the pdf document himself

I hope I was able to formulate a bit better of what I am trying to achieve.


Josh

  • Support Staff

May 9, 2018 at 2:18 pm

I’m afraid it’s the step 1 part I don’t understand, because the receipt template for the transaction isn’t intended to display the information you’re adding to it.


motio

May 9, 2018 at 3:28 pm

Okay, I see. I understand that is not intended for that purpose but it’s an quick workaround.

The best way would be to add a message group/type like the html receipt that is designed for this purpose.
For that I don’t know enough php and I think it’s way beyond my capabilities.

The most efficient way would be to add a php file that gets information of an event through the get-method and than use dompdf directly to get what I am trying to do.
The problem with this cases is, that I don’t know what information and which classes I have to include to make it work and more important how to make the get-method safe against sql-injunctions. I would need an example for that and I couldn’t find anything in that direction

I know that my approach is a workaround and not the most elegant way but it is in the reach of my capabilities. With that approach I only need a transaction token and I can use the backend of EE to create a template for that. With some custom shortcodes I get all the info that I need. The code isn’t probably not as efficient as it could be.

I was just wondering if there is a downside to that and if there is a good reason why I shouldn’t do that.


Tony

  • Support Staff

May 10, 2018 at 4:19 am

I was just wondering if there is a downside to that and if there is a good reason why I shouldn’t do that.

None that I can think of although as you already know this is a workaround that is using a function of EE in a way it wasn’t intended to be used, so I can’t say 100%.

The only way you’ll know if this is suitable is to try it out and see if it works well for you.


motio

May 11, 2018 at 5:33 am

Okay, thank you for the feedback. I’ll try it and will see.

Viewing 8 reply threads

The support post ‘Use receipt template for event specific documents’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso