Email Template for EdenHills

Hi,

I would like to create an email template that we can use instead of using the online booking form for EdenHills (cremation company) They are ok with it coming through as an email, so I just need to get my email working properly, which is what I'm having trouble with.

This is what their online booking form looks like:

This is what I have created so far in Email Template:

I would like to send it from the invoice screen so that it might possibly pick up the invoice item +/- the label:

Drug Label it prints:

When I try to use this email template, it gives me the following error:

does anyone know what the correct macros are?

Are the codes I can use for the vessel/product item and the weight?

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Re: Email Template for EdenHills

Try the following:

concat("Eden Hills Online booking from ", $location.name, $nl,
"Clinic Name: ", $location.name, $nl,
"Pet's Name: ", $patient.name, $nl,
"Surname: ", $customer.lastName, $nl,
"Breed: ", $patient.breed, $nl,
"Weight (kg):", party:getWeight($patient), $nl,
"Vessel choice: **choice**
Notes: **notes**
Engraving: **engraving**

The first 4 lines of engraving are free.
Each additional line costs $8

Staff Member: ", $user.name, $nl,
"Email address for a confirmation: ", party:getEmailAddress($location))

I don't think you will be able to get the vessel choice.

 

Re: Email Template for EdenHills

That's so great! Thanks Tim.

I can't get the Vessel Choice from "Product Description" or "Product Name" or anything?

Can I attach the Email Template to the product? Or to the Document that is already attached to the product "document document"?

Re: Email Template for EdenHills

For a Patient form, something along the lines of $product.entity.printedName in the template should allow product selection.

 

Simon Slater

Registered Linux User #463789 @ http://linuxcounter.net

Re: Email Template for EdenHills

Yes, I guess you could do that. When you charge the cremation product, you will end up with a Patient Form for it in Patients - Medical Records - Documents.

The only downside would be that it would also generate the cremation label as a PDF attachment in the email when you select Print -> Mail.

Here's the updated expression:

concat("Eden Hills Online booking from ", $location.name, $nl,
"Clinic Name: ", $location.name, $nl,
"Pet's Name: ", $patient.name, $nl,
"Surname: ", $customer.lastName, $nl,
"Breed: ", $patient.breed, $nl,
"Weight (kg):", party:getWeight($patient), $nl,
"Vessel choice: ", openvpms:get(., 'product.entity.name'), $nl,
"Notes: **notes**
Engraving: **engraving**

The first 4 lines of engraving are free.
Each additional line costs $8

Staff Member: ", $user.name, $nl,
"Email address for a confirmation: ", party:getEmailAddress($location))

Re: Email Template for EdenHills

Yes, that works perfectly. I will get staff to go to Patient Documents -> select the label -> print/mail.

It's totally fine that it has the drug label attached to the email, it's like a good double up.

Ah, this is going to save so much time, thank you.

Re: Email Template for EdenHills

Hi all,

I've been revisiting this idea over the last couple of days from the point of view of an interaction through the Supplier area of OP.  First, from Supplier>Information, clicking on an e-mail contact then selecting the appropriate Template.  This works well.  Second, a Supplier Form accessed through  Supplier>Documents which contains the required information and which would be attached to the e-mail, whose body is filled in by the Template.  This also works well.  In both cases the Edenhills product or code would need to be typed in the body of the e-mail, which shouldn't be a problem, since the epitaph also needs to be typed.

The first problem I'm having is getting the expression syntax correct for some fields.  Firstly [$OpenVPMS.location] or [$OpenVPMS.practice] gives the name, but extending to [$OpenVPMS.location.phone] throws "Expression Error" when previewing the Supplier Form.  What is the correct way to access practice/location phone number or address?

Secondly, this,  https://openvpms.org/documentation/csh/2.0/reference/reportFields#appFields , indicates that if a customer charge is selected, its details can be used.  Again [$OpenVPMS.invoice.author] and [$OpenVPMS.invoice.clinician] work fine.   But both [$OpenVPMS.invoice] and [$OpenVPMS.invoice.items] returns "Customer Invoice" in the Supplier form. 

In the Email Template, openvpms:get(., 'product.entity.name') throws the error "No node named product found in archetype act.customerAccountChargesInvoice" and using $invoice returns "org.openvpms.component.business.domain.im.act.FinancialAct@1c6756ba[quantity=,fixedAmount=,unitAmount=,fixedCost=0.000,unitCost=0.000,taxAmount=14.550,total=160.000,allocatedAmount=0.000,credit=false,printed=false]".

Is it possible to get an invoice item through a Supplier Form, in this case an Eden Hills Teddy for Cremains, from said charge? 

Simon Slater

Registered Linux User #463789 @ http://linuxcounter.net

Re: Email Template for EdenHills

For the telephone see https://openvpms.org/documentation/csh/2.0/reference/jxpath#contact E.g.

  • phone:format(phone:preferred($OpenVPMS.practice))
  • phone:format(phone:billing($OpenVPMS.location))
  • party:getTelephone($OpenVPMS.location)

For the author/clinician:

  • $OpenVPMS.invoice.author.entity.name
  • $OpenVPMS.invoice.clinician.entity.name

The following aren't particularly useful:

The reason openvpms:get(., 'product.entity.name') throws the error "No node named product found in archetype act.customerAccountChargesInvoice is because invoices have no product node. Products are at the item level.

In general, I don't think you can do anything with a supplier form and the invoice in the current context, as there is no link between the two.

 

 

Re: Email Template for EdenHills

Thanks Tim,

That's got the phones sorted.  I'll play with the list functions over the weekend.  I do need to spend more time getting to know how these functions work.

The main idea of what I was trying was just to do the same thing as Greta, but from a different angle.  For our (low) volume through Edenhills, typing their product and code at the same time as the epitaph is fine through the e-mail template, we don't need the form or, in Greta's case, the label.

Also I noted that the OP User Resource Library had no Supplier Forms.  So when I get this one looking pretty, I'll add it to the Catalogue.  It's for that purpose I'll play a little longer to get a list from the invoice.  Either way, with or without invoice items, I'll put the limitations in the explanation of the form.

Avagoodweegend!

Simon Slater

Registered Linux User #463789 @ http://linuxcounter.net

Syndicate content