Skip to content

E-Mail Templates - #3683

Closed
stephanarts wants to merge 23 commits into
owncloud:masterfrom
stephanarts:master
Closed

stephanarts wants to merge 23 commits into
owncloud:masterfrom
stephanarts:master

Conversation

@stephanarts

Copy link
Copy Markdown
Contributor

I did not like the e-mails sent by ownCloud, they were a bit 'clunky'.

So, I implemented two templates, one 'mail' and one 'altmail' for the HTML and ASCII e-mails. The 'built-in' templates use the original translations, and should be backwards-compatible with the old code in 5.0.

A logo-mail.gif is added, which is a modification of logo-wide.png because several mail-clients (including Outlook 2007 and several versions of Lotus notes) do not support .png images.

It is a drop-in replacement for the existing mail feature without breaking any translations and allows users to theme their e-mails.

Regards,

Stephan

@ghost

ghost commented Jun 12, 2013

Copy link
Copy Markdown

Can one of the admins verify this patch?

@karlitschek

Copy link
Copy Markdown
Contributor

good idea. But don't have time to test it currently.

@DeepDiver1975

Copy link
Copy Markdown
Contributor

@owncloud-bot this is ok to test

@DeepDiver1975

Copy link
Copy Markdown
Contributor

@DeepDiver1975

Copy link
Copy Markdown
Contributor

Two issues remain:

  • the link in the html should we an anchor tag
  • the image is embedded via relative link to the web page - which is for sure not working.
    It should either be embedded as link to an html attachment or as absolute path to the logo on the cloud
    Fist solution is preferred.

@stephanarts

Copy link
Copy Markdown
Contributor Author

The signed contributors agreement is in frank's mailbox.

  • Good point, I did not realise I removed the anchor tag from the template.
    • Adding that nicely would however break translations:
    p($l->t('User %s shared the file "%s" with you. It is available for download <a href="%s">here</a>', array($_['user_displayname'], $_['filename'], $_['link']))); ?> 
  • Well, it is working. But you get the annoying 'image blocked' message in every mail-client. And it's showing the alt-text instead until you unblock it. - I agree it's not perfect. I'll work on it.

@DeepDiver1975

Copy link
Copy Markdown
Contributor

The signed contributors agreement is in frank's mailbox.

THX

@karlitschek please confirm

@DeepDiver1975

Copy link
Copy Markdown
Contributor

Adding that nicely would however break translations:

I don't see an issue with this by now as for the master branch we get translations via transifex.
In case we backport this feature (which has to be decided later) we will manually transfer the translations.

Well, it is working. But you get the annoying 'image blocked' message in every mail-client

No - it's embedded via relative url as I've written above:



--b1_b5f3d67dc77a977853c07c62cace923e
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: 8bit

<table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr><td>
<table cellspacing="0" cellpadding="0" border="0" width="600px">
<tr><td bgcolor="#1d2d44" colspan="2">
<img src="/owncloud-community/core/img/logo-mail.gif" alt="ownCloud"/>
</td>
</tr>
<tr><td bgcolor="#f8f8f8" colspan="2">&nbsp;</td></tr>
<tr>
<td bgcolor="#f8f8f8" width="20px">&nbsp;</td>

@DeepDiver1975

Copy link
Copy Markdown
Contributor

@owncloud-bot retest this please

@stephanarts

Copy link
Copy Markdown
Contributor Author

I see .. I expected the image_path function to expand to an absolute URL... Fixed now.

@DeepDiver1975

Copy link
Copy Markdown
Contributor

I have, it worked for me.

ok - thanks a lot!

@stephanarts

Copy link
Copy Markdown
Contributor Author

O wait... you are talking about the anchor tag.

@stephanarts

Copy link
Copy Markdown
Contributor Author

Hold on. Will do that now.

@stephanarts

Copy link
Copy Markdown
Contributor Author

Sorry for the troubles, I overlooked it, it was indeed not working. Now it is.

@stephanarts stephanarts reopened this Jun 13, 2013
@karlitschek

Copy link
Copy Markdown
Contributor

@DeepDiver1975 confirmed. I got it.

@DeepDiver1975

Copy link
Copy Markdown
Contributor

confirmed. I got it.

THX

@DeepDiver1975

Copy link
Copy Markdown
Contributor

I'll retest this PR and we can merge.

@LukasReschke any sec relevant comments on this? THX

Comment thread core/templates/mail.php Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing . after the closing anchor tag

@DeepDiver1975

Copy link
Copy Markdown
Contributor

I think the logo would look a bit better with a bit more space around @jancborchardt
bildschirmfoto vom 2013-06-13 12 03 08

@DeepDiver1975

Copy link
Copy Markdown
Contributor

Comment thread core/templates/altmail.php Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

due to p() »%s« will be html escaped

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in commit 47b56d9

Comment thread core/templates/altmail.php Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stephanarts still cut the »here« after the »View it«. And also no dot after the link :)

Comment thread core/templates/altmail.php Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, one more. ;) only the »web services under your control« really needs to be translated here. And that string is already done. The rest should be hardcoded outside the translation call.

@jancborchardt

Copy link
Copy Markdown
Contributor

@stephanarts from my side just that string fix (see comments above) otherwise it’s great! And good call on displaying the link directly! :)

@stephanarts

Copy link
Copy Markdown
Contributor Author

Ok, squashed these commits in the email_template branch. :-)

@DeepDiver1975

Copy link
Copy Markdown
Contributor

Ok, squashed these commits in the email_template branch. :-)

Awesome! Thanks a lot! Let's close this pull request then and you submit the email_template branch again - okay?

@jancborchardt

Copy link
Copy Markdown
Contributor

@stephanarts the »ownCloud – « should also not be in the translation string. :)

@DeepDiver1975

Copy link
Copy Markdown
Contributor

We have the slogan already somewhere in the translations that way. Let's keep it. 

In addition it's easier for translators to have the full string. 

@jancborchardt

Copy link
Copy Markdown
Contributor

@DeepDiver1975 then we should fix that occurence as well. »ownCloud« should be nowhere in the translation files, at least not when it’s not even part of a sentence like here.

@DeepDiver1975

Copy link
Copy Markdown
Contributor

As stated  above translators have an easier job if we keep it.

Review process will ensure the typing is not changed. 

@jancborchardt

Copy link
Copy Markdown
Contributor

It’s already changed anyway. And it’s better in the long term if the slogan is separately translated. It already is in the translations as well.

@oparoz

oparoz commented Jan 8, 2014

Copy link
Copy Markdown
Contributor

There is an issue with the email template, only the text template gets fully translated. The main sentence in the HTML email is always displayed in English despite the sentence in the template and in the translation file being identical.

This is in the template:

$l->t('Hey there,

just letting you know that %s shared »%s« with you.
View it!

'

This is in the translation file

'Hey there,

just letting you know that %s shared »%s« with you.
View it!

'

EDIT:
This is the culprit:
»%s«

Replace with "%s" in all translations files and in mail.php and HTML text will get translated.

@ssams

ssams commented Jan 17, 2014

Copy link
Copy Markdown

I'm currently experiencing the problem described by @stephanarts a while ago about translations in international environments:

I have another remark though. I work in an organisation where we have people of various nationalities. (British, German, French, Dutch, Spanish, Italian and others...) They all have their desktops configured in their own language. But if a French colleague sends me a file, I get the e-mail in french. If I send an e-mail from my laptop, my Spanish colleague gets it in Dutch. etc...

Ofcourse, I can override this behaviour by providing a template that's not translated. Or working from an english workstation. But would it be nice to have an option: 'send e-mail in English' or 'do not translate e-mail'. Either available to the user, or configured at the system level?

Forcing all users to use a specific (foreign) language just to get notifications in the right language defeats the purpose of translation. Furthermore I can only overwrite the template generating the body of the email to not use translations, but as far as I understand there's no way to change the subject of the email without modifying owncloud core files directly (as it's located in .../owncloud/core/ajax/share.php).

I'd really like to see an admin option to disable translation for emails, or at least an easy option to override everything in templates.

@jancborchardt

Copy link
Copy Markdown
Contributor

@ssams right, interesting problem. Can you open a separate issue about this please? Thanks! :)

@lock lock Bot locked as resolved and limited conversation to collaborators Aug 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants