Changing the email body for transactions sent as a PDF attachment












2















When a Sales Order is emailed to a customer with Email Preference set to PDF, the body of the email reads:



Please open the attached file to view your Sales Order.

To view the attachment, you first need the free Adobe Acrobat Reader. If you don't have it yet, visit Adobe's Web site http://www.adobe.com/products/acrobat/readstep.html to download it.[/CODE]


I'd like to add onto this message a bit. I think that will require me to write a script that renders the transaction to a PDF template and sends the email with whatever message I choose. It also needs to prevent NetSuite from sending the default email as well.



Would the following work:



In a beforeSubmit function on Sales Order records, if the customer has Email Preference=PDF, uncheck the 'Email To' field. Set a new custom checkbox such as 'Email PDF' to true instead.



In a User Event Script, after a Sales Order submits and has 'Email PDF' set to true, render the transaction to a PDF and send it in an email to all the 'Email To' recipients.



Or is there a better solution I may be overlooking?



The 'duplicate question' says this can't be done yet I have a working solution. It also references SuiteTalk, not the same.










share|improve this question

























  • Possible duplicate of Netsuite suitetalk transaction email with pdf attachment intro text

    – Jdg50
    Jan 3 at 12:48











  • There's no answer there so that doesn't really help.

    – Badger
    Jan 3 at 23:09
















2















When a Sales Order is emailed to a customer with Email Preference set to PDF, the body of the email reads:



Please open the attached file to view your Sales Order.

To view the attachment, you first need the free Adobe Acrobat Reader. If you don't have it yet, visit Adobe's Web site http://www.adobe.com/products/acrobat/readstep.html to download it.[/CODE]


I'd like to add onto this message a bit. I think that will require me to write a script that renders the transaction to a PDF template and sends the email with whatever message I choose. It also needs to prevent NetSuite from sending the default email as well.



Would the following work:



In a beforeSubmit function on Sales Order records, if the customer has Email Preference=PDF, uncheck the 'Email To' field. Set a new custom checkbox such as 'Email PDF' to true instead.



In a User Event Script, after a Sales Order submits and has 'Email PDF' set to true, render the transaction to a PDF and send it in an email to all the 'Email To' recipients.



Or is there a better solution I may be overlooking?



The 'duplicate question' says this can't be done yet I have a working solution. It also references SuiteTalk, not the same.










share|improve this question

























  • Possible duplicate of Netsuite suitetalk transaction email with pdf attachment intro text

    – Jdg50
    Jan 3 at 12:48











  • There's no answer there so that doesn't really help.

    – Badger
    Jan 3 at 23:09














2












2








2








When a Sales Order is emailed to a customer with Email Preference set to PDF, the body of the email reads:



Please open the attached file to view your Sales Order.

To view the attachment, you first need the free Adobe Acrobat Reader. If you don't have it yet, visit Adobe's Web site http://www.adobe.com/products/acrobat/readstep.html to download it.[/CODE]


I'd like to add onto this message a bit. I think that will require me to write a script that renders the transaction to a PDF template and sends the email with whatever message I choose. It also needs to prevent NetSuite from sending the default email as well.



Would the following work:



In a beforeSubmit function on Sales Order records, if the customer has Email Preference=PDF, uncheck the 'Email To' field. Set a new custom checkbox such as 'Email PDF' to true instead.



In a User Event Script, after a Sales Order submits and has 'Email PDF' set to true, render the transaction to a PDF and send it in an email to all the 'Email To' recipients.



Or is there a better solution I may be overlooking?



The 'duplicate question' says this can't be done yet I have a working solution. It also references SuiteTalk, not the same.










share|improve this question
















When a Sales Order is emailed to a customer with Email Preference set to PDF, the body of the email reads:



Please open the attached file to view your Sales Order.

To view the attachment, you first need the free Adobe Acrobat Reader. If you don't have it yet, visit Adobe's Web site http://www.adobe.com/products/acrobat/readstep.html to download it.[/CODE]


I'd like to add onto this message a bit. I think that will require me to write a script that renders the transaction to a PDF template and sends the email with whatever message I choose. It also needs to prevent NetSuite from sending the default email as well.



Would the following work:



In a beforeSubmit function on Sales Order records, if the customer has Email Preference=PDF, uncheck the 'Email To' field. Set a new custom checkbox such as 'Email PDF' to true instead.



In a User Event Script, after a Sales Order submits and has 'Email PDF' set to true, render the transaction to a PDF and send it in an email to all the 'Email To' recipients.



Or is there a better solution I may be overlooking?



The 'duplicate question' says this can't be done yet I have a working solution. It also references SuiteTalk, not the same.







netsuite suitescript2.0






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 4 at 4:23







Badger

















asked Jan 2 at 23:29









BadgerBadger

959




959













  • Possible duplicate of Netsuite suitetalk transaction email with pdf attachment intro text

    – Jdg50
    Jan 3 at 12:48











  • There's no answer there so that doesn't really help.

    – Badger
    Jan 3 at 23:09



















  • Possible duplicate of Netsuite suitetalk transaction email with pdf attachment intro text

    – Jdg50
    Jan 3 at 12:48











  • There's no answer there so that doesn't really help.

    – Badger
    Jan 3 at 23:09

















Possible duplicate of Netsuite suitetalk transaction email with pdf attachment intro text

– Jdg50
Jan 3 at 12:48





Possible duplicate of Netsuite suitetalk transaction email with pdf attachment intro text

– Jdg50
Jan 3 at 12:48













There's no answer there so that doesn't really help.

– Badger
Jan 3 at 23:09





There's no answer there so that doesn't really help.

– Badger
Jan 3 at 23:09












1 Answer
1






active

oldest

votes


















2














This is a solution someone gave me on the official NetSuite forum:



You can accomplish this fairly easily with a Workflow.

- Trigger on Before Record Submit when 'To Be E-mailed' = T
- Set Field Value of 'To Be E-mailed' = F
- Transition to next state After Record Submit
- Use 'Send Email' action. This allows you to use an email template and
also automatically attach pdf





share|improve this answer
























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54014541%2fchanging-the-email-body-for-transactions-sent-as-a-pdf-attachment%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2














    This is a solution someone gave me on the official NetSuite forum:



    You can accomplish this fairly easily with a Workflow.

    - Trigger on Before Record Submit when 'To Be E-mailed' = T
    - Set Field Value of 'To Be E-mailed' = F
    - Transition to next state After Record Submit
    - Use 'Send Email' action. This allows you to use an email template and
    also automatically attach pdf





    share|improve this answer




























      2














      This is a solution someone gave me on the official NetSuite forum:



      You can accomplish this fairly easily with a Workflow.

      - Trigger on Before Record Submit when 'To Be E-mailed' = T
      - Set Field Value of 'To Be E-mailed' = F
      - Transition to next state After Record Submit
      - Use 'Send Email' action. This allows you to use an email template and
      also automatically attach pdf





      share|improve this answer


























        2












        2








        2







        This is a solution someone gave me on the official NetSuite forum:



        You can accomplish this fairly easily with a Workflow.

        - Trigger on Before Record Submit when 'To Be E-mailed' = T
        - Set Field Value of 'To Be E-mailed' = F
        - Transition to next state After Record Submit
        - Use 'Send Email' action. This allows you to use an email template and
        also automatically attach pdf





        share|improve this answer













        This is a solution someone gave me on the official NetSuite forum:



        You can accomplish this fairly easily with a Workflow.

        - Trigger on Before Record Submit when 'To Be E-mailed' = T
        - Set Field Value of 'To Be E-mailed' = F
        - Transition to next state After Record Submit
        - Use 'Send Email' action. This allows you to use an email template and
        also automatically attach pdf






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 3 at 23:21









        BadgerBadger

        959




        959
































            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54014541%2fchanging-the-email-body-for-transactions-sent-as-a-pdf-attachment%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            MongoDB - Not Authorized To Execute Command

            How to fix TextFormField cause rebuild widget in Flutter

            in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith