Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Subject and attachment name on Gendoc generated e-mails
#6
No, you did it correctly, I didn't understand.

I looked into it and remembered that this is how it works. You are sending the email to the account/contact and only that module is supported for merging variables. This comes all the way back from vtiger crm where it was hard to do the merge for other modules. In coreBOS the email module has support for a Merge_Template_With list of IDs that will get their variables merged. So I added the quote (and other inventory modules) to that variable and it seems to be working. Update and give it a try.

Workflow_Email_GenDoc_Attachment_Name only applies to workflows, that is why there is no change in the template name

To make the change of the name you have to pass the subject to gendocAction() so you can substitute the crmid in the line you set in red above and then you have to apply this change in the GenDoc module


Code:
diff --git a/modules/evvtgendoc/gendocAction.php b/modules/evvtgendoc/gendocAction.php

index 1b8b841d2..4deec6d04 100644
--- a/modules/evvtgendoc/gendocAction.php
+++ b/modules/evvtgendoc/gendocAction.php
@@ -121,7 +121,7 @@ if ($mergetemplate=='1') {
                                }
                                break;
                        case 'email':
-                               $sname = 'storage/'.$modulei18n.'_'.$record.($format=='doc'?'.odt':'.pdf');
+                               $sname = 'storage/'.$modulei18n.'_'.$einfo[$record].($format=='doc'?'.odt':'.pdf');
                                if (file_exists($sname)) {
                                        unlink($sname);
                                }


you have to be sure to generate the same name in javascript and PHP.

The hard part is getting the information you want in the gendocaction call. I would prefer to use a business map to define how the name should be generated, but that is not a trivial task.

Let me know how it goes
Joe
TSolucio
Reply


Messages In This Thread
RE: Subject and attachment name on Gendoc generated e-mails - joebordes - 03-21-2021, 12:27 AM

Forum Jump:


Users browsing this thread: 2 Guest(s)