7 Replies Latest reply on Oct 15, 2016 10:22 AM by mweldon@ansi.org

    How to get paragraph return in email text

    martinc

      Hello,

       

      I have a PSOS script that runs a sales report and sends a weekly email.  An attachment would be nice but...server can't handle that and I can't seem to get the 360works plugin to work.

       

      I tried to get returns for each chunk of info but the returns don't seem to actually create a return in the email.  Is there something else I could add?

      Here is the portion of the script that builds the text in a loop:

      Screen Shot 2016-10-14 at 7.41.55 AM.png

       

      Here is the email:

      Screen Shot 2016-10-14 at 7.43.20 AM.png

      It's kind of lame..

        • 1. Re: How to get paragraph return in email text
          beverly

          I stopped using the pilcrow in calculations. I now use

          Char(13)

           

          Your email client may still not understand, but at least you know what gets sent.

           

          In your script I don't see where $cc is set and I do see $cc and $CC (which are not the same variable).

           

          HTH,

          Beverly

          • 2. Re: How to get paragraph return in email text
            user19752

            The mail looks like not result of the script, script makes text as

            Count of invoices:

            but the mail shows

            count of Inv.:

             

            And the mail has line break successfully at first 2 lines, how do you got it?

             

            If pilcrow or Char(13) failed, use CRLF as Char(13) & Char(10). This is the standard of e-mail line break. (but I think the conversion should be done in internal process that FM makes mail message, user shouldn't need to care...)

            1 of 1 people found this helpful
            • 3. Re: How to get paragraph return in email text
              philmodjunk

              The pilcrow operator has always worked for me.

               

              But I would avoid the use of Insert Calculated result for this. It only works if the field is present on the current layout so it's vulnerable to future layout changes. It can also trip script triggers with unintended results.

               

              Use set field instead:

               

              Set Field ( Invoices::ScriptVariableGlobal ; List ( Invoices::ScriptVariableGlobal ; "Phase " & cc$ & "$... ) ]

              • 4. Re: How to get paragraph return in email text
                philmodjunk

                I so seldom use an "insert" type step unless working with a container field that I decided to run a test.

                 

                Using FileMaker 15 and Windows 10, I can't reproduce the results shown here--at least not in the global text field. When I run such a script, the Pilcrow operator puts the returns right where they are needed. This leads me to ask a question:

                 

                When you check the global text field, rather than the email, do you see text correctly separated by returns, but then the email body that a recipient gets is messed up? Or is it wrong in the global field?

                 

                If you see it messed up in the global field, do you have any auto-enter calculation set up for that field?

                 

                You can test/examine the attached file to compare your results to mine.

                • 5. Re: How to get paragraph return in email text
                  mweldon@ansi.org

                  Hi Martin...Your question is not lame at all.

                  Paragraph returns should be placed in quotes like any text string. Here is a simple example where I have placed return symbols in a text string with quotes. Note that two return symbols results in two line breaks.

                   

                  Here is the script...

                  "Dear " & Database::First Name &  ",¶"  & "Please contact me at your earliest convenience with any questions or concerns.¶¶" & "Thanks very much,¶Mary Watson¶My Company Name¶my@company.org"

                   

                  Here is the result...

                  Dear Martin,

                  Please contact me at your earliest convenience with any questions or concerns

                   

                   

                  Thanks very much,

                  Mary Watson

                  My Company Name

                  my@company.org

                  • 6. Re: How to get paragraph return in email text
                    philmodjunk

                    While the pilcrow can be placed in quotes, it can also be used as an operator and then not placed in quotes. You only have to put it in quotes if you have more than pilcrow in a row.

                     

                    See my example file in my previous response. The pilcrow is not placed in quotes and it produces the desired result.

                    • 7. Re: How to get paragraph return in email text
                      mweldon@ansi.org

                      yes, I agree. My suggestion was one option that works and I find it visually helpful to have it in quotes.