• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

CF9 cfmail text email - formatting question

LEGEND ,
Feb 05, 2013 Feb 05, 2013

Copy link to clipboard

Copied

Hello, everyone.

I'm using CFMAIL to send a text-format email whenever a database record is inserted or updated.  Works great, I just have one question.

Since the information contained is dynamically generated, how can I indent a block of text?  Can't use <blockquote>, that just appears in the email as "<blockquote> text </blockquote>"; it's displayed, not parsed.

Is there a way to indent a block of text if the email generated is text instead of HTML?

Thanks,

^_^

Views

727

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 05, 2013 Feb 05, 2013

Copy link to clipboard

Copied

The thought occurred to me as soon as I hit the POST button: If text-formatting strips out all HTML, there is (I'm guessing) no way TO format it, if the text is dynamically generated.

Sure, if it is hard-coded, static text, you can use spaces on every line to faux-indent the text.  But dynamically generated, most likely it's a pain to do, if it can be done.

So, I guess I'm just hoping for other people's thoughts?

Thanks,

^_^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 05, 2013 Feb 05, 2013

Copy link to clipboard

Copied

LATEST

chr() is your best bet to format plain text emails for indentation. For example, chr(9) will give you a tab character, which should indent the text in the email based on the email clients interpretation of a tab (usually 4 or 8 spaces, depending on the email client) Any ASCII code (http://www.asciitable.com/) can be used with chr() in plain text emails. I use it all the time.

An alternative would be RepeatString(), which would allow you to indent the number of spaces you prefer.

With dynamically generated content, you may have to append the chr() code to the string before it's added to the email (e.g. parse the query and add in the chr() codes you need). Ultimately, you're better off in either case *not* using the dynamic functions and formatting it the way you want by looping through the query in question and outputing the formatted text the way you want with each record.

HTH

-- Denny

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation