Hi,
I need to send pdfs by email.
I've downloaded the module and I don't understand how I can generate and attach the PDF.
I'm working with print module.
This is my rule:
{ "rules_generate_pdf" : {
"LABEL" : "Generate and send PDF",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"TAGS" : [ "invoice", "teacher" ],
"REQUIRES" : [ "rules", "rules_download", "mimemail" ],
"ON" : { "node_update--invoice" : { "bundle" : "invoice" } },
"IF" : [
{ "data_is" : { "data" : [ "node:field-inovice-status" ], "value" : "ok" } },
{ "entity_has_field" : { "entity" : [ "node:field-student" ], "field" : "field_mail" } }
],
"DO" : [
{ "rules_download_action_generate_path" : {
"USING" : {
"path" : "printpdf\/[node:nid]",
"cookie" : 1,
"uri_scheme" : "public",
"temporary" : 1
},
"PROVIDE" : { "rules_download_file" : { "rules_download_file" : "Downloaded file" } }
}
},
{ "rules_download_action_realpath" : {
"USING" : { "file" : [ "rules-download-file" ] },
"PROVIDE" : { "rules_download_file_path" : { "rules_download_file_path" : "File real path" } }
}
},
{ "mimemail" : {
"key" : "invoice_[node:nid]",
"to" : [ "node:field-student:field-mail" ],
"subject" : "Factura [node:field-text1]",
"body" : "Your invoice.",
"attachments" : "[rules-download-file-path:value]",
"language" : [ "" ]
}
}
]
}
}
Thanks!
Comments
Comment #1
dromansab commentedComment #2
ericwongcm commentedI think we are both trying to do the same thing?
Did you see the issue I posted?
https://drupal.org/node/2264671
Comment #3
dromansab commentedYes... at least the first part (generate and attach the document).
I want to send the PDF when the node is updated, and you are looking for change the "Send by mail" action provided by print module.
Comment #4
hanoiiYour rule seems fine realy, what's happening to you?
Comment #5
dromansab commentedThe system sends the email without attachment
Comment #6
cgdrupalkwk commenteddromansab,
Can you get minemail to send attachments without using the Rules Download Module?
Comment #7
dromansab commentedI haven't try it.. How can I check it? Can you post an example, please?
Thanks
Comment #8
hanoiiI just released version 2.0 with a different approach within rules, and now basically using [rules-download-file:path] on the attachments form should work.
Comment #10
thomasmurphy commentedI am trying this approach but there is no PDF attached to the email sent, and the token [rules-download-file:path] doesn't render at all, even I attempt to display the rendered token in the body or in message. I am using the print module with WKHTML and mimemail modules,