Best way to format HTML email

Sort:
You are not authorized to post a reply.
Author
Messages
Chris Beecy
New Member
Posts: 4
New Member
    I am wondering how other IPD developers format the HTML message of an Email node. I tried to create a formula/variable with to simulate a CSS style sheet but it "sorta" worked but not completely. I have had luck using inline styles but that spreads the formatting around (as I build the message) AND cannot be reused. What I'm hoping for is a way to define a CSS Style Sheet in a variable (or global configuration) and reuse for all flows that need to send an email that conform to a single standard. I am a IPD newbie but strong in HTML/CSS/JS...
    jamesraceson
    Veteran Member
    Posts: 52
    Veteran Member
      Chris,

      So, "technically" is possible to do this through a formula/variable process. However, because of the special characters, you would have to do a lot of formatting and/or reg expression processing to make this work correctly. With the amount of work you would have to put into doing that, it might not be worth the reward. What I have done in the past is to save off the CSS header information in another file or repository and just cut/paste into the email node that I'm using for that flow. Yes, it isn't as elegant as calling up a function to have it just appear, but it works, it is fast, and simple. Another advantage is if you have to make any changes it is much easier to do that in the email node then opening up the function file, make your changes, save the file on the server, test, rinse-lather-repeat.
      Chris Beecy
      New Member
      Posts: 4
      New Member
        Thank you James! I will try that. I would prefer working to elegant :-) and agree about the flexibility. Best! Chris
        Dave Curtis
        Veteran Member
        Posts: 136
        Veteran Member
          I typically use a message builder to build the HTML for the email node (or just build it in the email node) and use JavaScript to create sections that are not static, things like bold of a section based on results or the color of sections based on results of the process, etc.

          I have had an idea to use a system configuration property or Custom field to store some standard header HTML and then reference that. Just to have some of the HTML saved as a standard item that can be used but I have not tested or played around with the idea yet.

          FireGeek21
          Veteran Member
          Posts: 84
          Veteran Member

            We have built the html directly into the msgbuilder.  Then we call the msgbuilder variable name in the email body.

             

            FireGeek21
            Veteran Member
            Posts: 84
            Veteran Member

              @Dave,

              I have used system configurations to store chunks of standard html.  I found you have limitations as far as how much you can put in one of those system configuration variables.  This will lead to you having several system configuration chunks. 

              I have also seen a separate process flow created solely for producing an email error handler.  Lots of html was stored in system variables and then referenced in this one flow which was then reused as a trigger in other flows.  I thought this was cumbersome to build but once it was built it was nice to have one place to edit the one email error notification used in several flows.

              It works either way though.

               

              Attachments
              Dave Curtis
              Veteran Member
              Posts: 136
              Veteran Member

                FireGeek21 - Thanks, that was the part I was not sure about, I had put some header HTML in a config parameter field but had not tested just how much could be stored.  Since building the HTML is not super time consuming, I had not gone back to do additional testing.  

                I had also thought of using a text file stored on the server and referencing it with a file read and pull the sections by referencing specific start/end points of the file, but, again - the testing effort is not worth the "payout" at this point.  As they say - "The juice just isn't worth the squeeze [not yet anyway]"

                Chris Beecy
                New Member
                Posts: 4
                New Member
                  Thank you to everyone for your feedback. We were able to get this working as desired. We created a variable/formula with the styles, I included the style "code" in an attachment. We then placed a reference to that variable/formula at beginning of Email message. The next step is to move it to a configuration set. Thanks again for the feedback.
                  Attachments
                  You are not authorized to post a reply.