Edit Email Message Look

Edit Email Message Look

de Carlos twt -
Number of replies: 10

Hello, 

Im using moodle 3.1 

I want to change the look of the emails the users receive when I create the accounts by .csv

In the email the students have: their loging credentials (password created at random but forced to change) and the page url is given to them .


*The problem is the message is just a white plane text and dot'n even have spaces or breaks.


Ex1:  Text by deafault


Ex2: After I modify some thing now I get this:


In Both cases it's not what I want for the new students.


What I want?

In the best case I would like and image with HTML links.

In the worse case at leats a spaced text with bolds and links.


Worse case example:


The problem when I edit at:

Site Administration>Language>Language customisation>(language) > Open language pack for editing > moodle.php>show strings >page11

In the "textarea" box I can't edit like in a html editor.

This Is where I shoud edit the email message:



Note: The site have no autoenroll enable thats why by demand we enroll by .csv.


Thank you for anything you coud help with.

Cheers. 

Promeyo de puntuacions: -
In reply to Carlos twt

Re: Edit Email Message Look

de Ken Task -
Imachen de Particularly helpful Moodlers

So what do you have to edit web pages in a GUI?

Copy the text you see to a local web page GUI and make changes.  Do NOT use Word or any Office Suite word processing app.  Probably best if you can find a true web page editor that won't insert any special tags of it's own.

But that won't store your images in Moodle ... images would have to be full URL src types, me thinks.

So how about a way with Moodle where you do have a the editor tool bar?

Copy the text and paste to a text file to keep locally - whatitsaysnow.txt

Then, go to a system admin level cateogry/course and create a Web Page resource.

In the body of that web page, turn on the tool to see raw html ... paste contents of whatitsaysnow.txt into the web page.

Now the tricky part ... inserting your 'fancy' without loosing the 'placeholder' tags.  If you get that to display then it *might* work with pasting that html into the dailog box of the custom language.

Haven't done this before myself .. so consider this to be a suggestion.

Others?

'spirit of sharing', Ken


In reply to Ken Task

Re: Edit Email Message Look

de Carlos twt -

Hello, 

thanks for answering but indeed I've tried using the web page resourse adding <strong> and other tags like <b>, <br>...

 but in the message, I get this tags as text.



In reply to Carlos twt

Re: Edit Email Message Look

de Ken Task -
Imachen de Particularly helpful Moodlers

That might be true ... no tags accepted but the '{$a->variable}' types.

The only other way that might be possible (but somewhat risky) is editing the table.

See if this query begets the text you desire to change/edit:

select * from `mdl_tool_customlang` where `stringid` like "%newusernewpasswordtext%"

IF so, then try just ONE simple HTML link to an image .... like ...

<img src=URL .... the URL to the image would have a FULL url and  be outside of Moodle me thinks so you might have to create a directory inside Moodle code directory called something that wouldn't conflict with core code directories and then place image files in there.  Use lower case letters and DO make the image files 'web ready' as well as sized appropriate to a mail reading app.

Still though, it might not work. :\

Always a good idea to backup your DB before working directly with it .... and know how to restore it should things go wrong.

Good Luck!

'spirit of sharing', Ken

In reply to Ken Task

Re: Edit Email Message Look - lang customisation problem

de Helen Foster -
Imachen de Core developers Imachen de Documentation writers Imachen de Moodle HQ Imachen de Particularly helpful Moodlers Imachen de Plugin developers Imachen de Testers Imachen de Translators

Hi Carlos,

Looking at your screenshot of the Language customisation interface, I think it may be a bug not having line breaks. It should look like this:

I'm just moving this thread to the Languages forum where all the language editing experts hang out...

In reply to Ken Task

Re: Edit Email Message Look

de Carlos twt -

Hello,

Ty for the recommendations


Based in the fact i'm not a programmer I decide to not do undercode programming. But I give a chance to another editor so I use (notepad++)

As result I get the email with the spaces I was looking for.



So for the last thing, 

 Bold titles coud be possibe?  the tag <b> just not work, Any Idea? or the plain text would bethe law?


PD: For now I thing an image as email have to be discarted.

In reply to Carlos twt

Re: Edit Email Message Look

de David Mudrák -
Imachen de Core developers Imachen de Documentation writers Imachen de Moodle HQ Imachen de Particularly helpful Moodlers Imachen de Peer reviewers Imachen de Plugin developers Imachen de Plugins guardians Imachen de Testers Imachen de Translators

the tag <b> just not work

Weird. I would expect it works. What is displayed instead of it?

image as email have to be discarted

Well, I assume that if you publish that image on a public URL, and use the standard <img> tag, it should work. Still note that many email clients including GMail etc are pretty conservative about it and they may refuse to display such images anyway.

In reply to David Mudrák

Re: Edit Email Message Look

de Carlos twt -

Hi

When I use <b> tag the message show the tag as normal text:


Hi xxxx xxxx, 

A new account has been created for you at 'xxxxxxx' and you have been issued with a new temporary password.

Your current login information is now:<b>username:</b> xxxxx <b>password: </b> JKfkgPe7W

<b>(you will have to change your password when you login for the first time)</b>

...

And the same with other tags as <br> or <strong>


I also try to use Markdowns for Emphasising Text:  

Ex: *italic*, **bold**


But it does not work. 


In reply to Carlos twt

Re: Edit Email Message Look

de David Mudrák -
Imachen de Core developers Imachen de Documentation writers Imachen de Moodle HQ Imachen de Particularly helpful Moodlers Imachen de Peer reviewers Imachen de Plugin developers Imachen de Plugins guardians Imachen de Testers Imachen de Translators

Weird. I would expect that HTML tags work...

Later: I just looked at the code and it seems it is a bit more complex. In this case, the string is really sent as a plain text only. The string would be sent as HTML too only if the mustache template lib/templates/email_html.mustache were overwritten by the theme.

In reply to Carlos twt

Re: Edit Email Message Look

de David Mudrák -
Imachen de Core developers Imachen de Documentation writers Imachen de Moodle HQ Imachen de Particularly helpful Moodlers Imachen de Peer reviewers Imachen de Plugin developers Imachen de Plugins guardians Imachen de Testers Imachen de Translators

Just note, looking at how the string newusernewpasswordtext is used in the setnew_password_and_mail() function, it is used as the text for both text emails and HTML formatted emails. All the HTML tags you use in it will be visible to users who prefer plain text emails (that is why we normally have both plain text and HTML text variants for email texts).

I think that Helen is right. As the text_to_html() function is used to convert the string value to the actual email HTML, you are supposed to have the new lines in the string.