Email notification customization


#1

1) Give a description of the problem
Trying to figure out how to customize the email notification layout/design

2) What is the expected behavior?
Want to be able to set certain parts of the message as headers, font size/weight change etc.

3) What is happening/not happening?
Just don’t know if this is possible?

**4) Post a Green Snapshot of the piston!
N/A

Just looking to see if there is any way to add custom HTML/CSS to a notification expression?


#2

I’m sure you can change the body using some of that. Never have done it but use the expression option for the body


#3

I wonder if this is something the webcore profis know about, like @Robin or @c1arkbar or @Cozdabuch ??


#4

I do not know of any way to change the format of the email body text. @ipaterson or @bangali ??


#5

not tried it but first thing i would try is embed html tags in the body and see if that formats the email correctly within gmail.


#6

It seems it is possible and that HTML tags can be added… but it’s super glitchy. They seem to just get hidden, sometimes the entire tag, and sometimes only half the tag… but they work. I need to try another browser to see if that helps. Any other suggestions would be welcome!


#7

try another email provider as well.


#8

Wow that is no understatement, it’s crazy. The problem seems to be fixed in a later version of the text editor component; I’ll test out upgrading that component.


#9

funny … i had read that as - email provider was eating the <tags> :joy:


#10

That was my interpretation also hehe


#11

A later version seems to fix that but it is incompatible with some of the customizations that ady made. I left an in-progress version but it will need to be revisited later. Instead of glitching out it ends up showing the HTML encoded characters sometimes (&lt; rather than <).

Until that can be updated you’ll have better luck with the Value field which is just a simple text input, or with storing your HTML tags in variables. For example, string h1 = '<h1>' and string _h1 = '</h1>' then in your expression {h1}Here are your headlines:{_h1}. Yuck esp. since you already have a ton of variables, but no glitches.


Email Action enhancement
#12

Very creative though!


#13

Sorry! I should have been more clear :joy:

This looks like a viable solution! I have a couple of ideas to manipulate this further. I’ll give it a shot and let y’all know how it comes out! Thanks for the help folks.


#14

Success! I opted to simply write my HTML tags in as global variables so that I can reuse them any time. I then just included the CSS inside the HTML tag instead of creating a stylesheet and linking out to it being hosted somewhere. Here’s a first draft of how it’s looking:


#15

ehh … my bad, should have read it right :slight_smile:


#16

If you want something a bit more useful, format() would be a good option. string @headingFormat = '<h1>%s</h1>' and string @storyFormat = '<a href="%s">%s</a><br/>%s<br/>%s' which would be used like format(@headingFormat, 'Here are your headlines:') and format(@storyFormat, url1, title1, author1, description1)


#17

Would you mind explaining the format( ) function in, like, dumber terms? I’m really new to any kind of coding, and I’m trying to learn as quickly as possible. The functions with ( ) at the end in webCoRE are one aspect of the rules engine that I have not really wrapped my head around.


#18

Crash course! The format function takes two or more “arguments” which come between the () and are separated by commas. For your case each argument can be a variable like the story format example, or literal text wrapped in quotes like the heading example.

The first argument is the template, each %s is replaced by the next argument consecutively until everything is matched up. Then the function returns that template with everything filled in. Just be sure to include the correct number of arguments in the correct order to match the format template.

So if you have a variable named winner with the value “Bob” then format('The %s is: %s', 'winner', winner) will give you “The winner is: Bob”

You can use functions in either the Value or Expression inputs. In the Value input that would look like The maximum is {max(score1, score2)} and in the Expression input you can do either 'The maximum is {max(score1, score2)}' or 'The maximum is ' + max(score1, score2) which will produce the same result.

The reason it works for your HTML issue is because that bug only affects the Expression editor and you’re typing the HTML into the variable value instead.


#19

Good deal! I will need to give this a shot some time! For now, I stuck with what I know:

(This image was exposing your email addresses so it was removed for your protection)