I'm working on a project where the goal is to take information from an Ubercart order and apply it to a permit that will send as a PDF file. So I've set a Rule that triggers when a specific product is ordered, the system will send an e-mail containing the desired contents with replacement tokens to the customer. I'm able to do this to send this as an e-mail. But we need it to send this content as a PDF file. The reason we need this is because we do not want customers to be able to edit the content before printing it. Can anyone assist with adding an option to Rules that will allow e-mails it sends to be sent as an attached PDF file? Maybe just have a checkbox in the area where you define the message of the e-mail that says "Send message as PDF attachment". We are willing to pay a bounty to anyone that can add this functionality as a new module. Maybe call it "Rules PDF Mailer" or something like that. I'll have to double-check on the amount we can pay before posting it here, but I figured I'd see if there are any other ways of doing this that someone can suggest that do not require module development. Unfortunately, we have a deadline for this on Monday. I know that is seriously short notice. Thanks in advance if anyone here can assist. I am already talking with a developer I previously met here, but I want to see if anyone else has some ideas.
Comments
Not tried myself,
Not tried myself, but:
#1434438: Some Print PDF Rules integration might serve as a starting point. It is meant to send a PDF of a node, though, but seems to be already there.
And what if you saved your permits as nodes? or would it be a security concern?
I don't think I can save the permit as a node because...
the permit will use a replacement token from the order to autopopulate the Participant Name. So every PDF that goes out will be unique and pull data from the Ubercart order. If I can do that and save it as a node in some way I'm not thinking of, I'm open to ideas. I was thinking I could do it through Views using Views PDF in some way, but I couldn't find the necessary Views integration for Ubercart orders in Drupal 7.
I think the best way to do this is to add an option to Rules that will allow e-mails sent by Rules to have a "Send as a PDF" option.
If you can autopopulate text
If you can autopopulate text fields for the mail message, you can as well use the same text for the body of a new node. Rules certainly can create new nodes (need to look under Entities, not under Node, which might be somewhat confusing). Or am I missing something?
I reckon the reason nobody has implemented an option to send text as PDF is that few people would need or like to send basically plain text without any styling this way.
Not saying permits as nodes are the silver bullet - there are multiple pro et contra arguments, and I'm probably not aware of all background details either.