Questions around the TYPO3 integration and plugins as well as Flow and NeosCMS
Forum rules: Always add your TYPO3/Flow, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
#2280 by Alexander
27 Dec 2015, 15:05
Hello all,

I have some questions about payment e-mails.
How is it possible to remove all html-parts from the e-mail? - It should be text-only.
How can I add a little imprint to this e-mail? Is there a simple TypoScript-command?
There's also a bit strange problem with sending e-mails, but I don't know if this has to do with Aimeos: As long as there are no e-mails to send, the task for sending e-mails is executed every minute (in planned tasks, the date/time-stamps are updated correctly), but as soon as there is actually an e-mail to send, no e-mail is being sent and "last execution" does not update anymore and "next execution" gets an "-". Manual execution of the task works, and the e-mail is being sent.
Thanks in advance!

Best regards

Alexander
#2283 by aimeos
28 Dec 2015, 13:34
Alexander wrote:How is it possible to remove all html-parts from the e-mail? - It should be text-only.


You can remove the HTML subpart via configuration:
https://aimeos.org/docs/Configuration/Core/client/html/email/payment/default/subparts

Alexander wrote:How can I add a little imprint to this e-mail? Is there a simple TypoScript-command?


There are two ways: Either overwrite the translation of the "outro" or "legal" subpart via TypoScript or replace the legal subpart with your own template. You can find all information about adapting the e-mails in these articles: https://aimeos.org/docs/Configuration/Core/client/html#E-mail

Alexander wrote:There's also a bit strange problem with sending e-mails, but I don't know if this has to do with Aimeos: As long as there are no e-mails to send, the task for sending e-mails is executed every minute (in planned tasks, the date/time-stamps are updated correctly), but as soon as there is actually an e-mail to send, no e-mail is being sent and "last execution" does not update anymore and "next execution" gets an "-". Manual execution of the task works, and the e-mail is being sent.


Are there any error messages in the log (admin interface, first tab, second panel) resp. in the madmin_log table?
#2287 by Alexander
28 Dec 2015, 17:29
Thank you very much for your help!
It's working now except the imprint.
How can I append to the legal part? - Sorry for asking stupid questions. I am new to TYPO3 and Aimeos. I even don't know where to find the necessary information.
In the tasks TypoScript-configuration I was just trying this: client.html.email.payment.text.legal := appendString(Imprint)
What's the variable of the processed legal-string, or is there an .appendto-field?
#2290 by aimeos
29 Dec 2015, 22:07
Alexander wrote:How can I append to the legal part? - Sorry for asking stupid questions. I am new to TYPO3 and Aimeos. I even don't know where to find the necessary information.


There's no TypoScript variable available where you can append text - you can only overwrite the translations. How translations are overwritten can be found here: https://aimeos.org/docs/TYPO3/Overwrite_translations

You need the original English string which in case of the legal text is rather long:
https://github.com/aimeos/aimeos-core/blob/2015.10/client/html/layouts/email/common/html-legal-body-default.html#L12

In TypoScript it would be:
Code: Select all... {
  domain = client/html
  string = All deliveries shipped are subject to our terms and conditions, which are available on our website and which you accepted when placing your order.\n\nThis email contains confidential information and is exclusively for the use of the person addressed. Should you not be that person then please reply to this e-mail and delete the e-mail and attachments afterwards.
  trans = ...
}
#2292 by Alexander
30 Dec 2015, 14:10
Thanks, but unfortunately it's not working.
In the e-mail-tasks TypoScript configuration I have:

plugin.tx_aimeos.settings.client.html.email.payment.default.subparts {
0=text
}
plugin.tx_aimeos.settings.i18n.en.0 {
domain = client/html
string = If you have any questions, please reply to this e-mail
trans = If you have any questions, please reply to this e-mail\n\nIMPRINT
}
plugin.tx_aimeos.settings.i18n.de.0 {
domain = client/html
string = If you have any questions, please reply to this e-mail
trans = Falls Sie Fragen haben sollten, antworten Sie bitte auf diese E-Mail\n\nIMPRESSUM
}

The first command works well, and removes the html part, thus is being executed, but the others have no effect. Is there a mistake in this code?
#2293 by aimeos
30 Dec 2015, 16:09
Alexander wrote:
Code: Select allplugin.tx_aimeos.settings.i18n.de.0 {
  domain = client/html
  string = If you have any questions, please reply to this e-mail
  trans = Falls Sie Fragen haben sollten, antworten Sie bitte auf diese E-Mail\n\nIMPRESSUM
}


The TypoScript code is OK. Which TYPO3 version are you using and what scheduler task (E-Mail or Extbase)?
#2295 by aimeos
30 Dec 2015, 17:15
Alexander wrote:It's TYPO3 7.6.0 and the task is aimeos->Planer for Aimeos Shop E-Mails.


Are both languages active in the admin interface (Locale tab -> Language sub-tab)?
Can you try sending e-mails with the Extbase task for a quick test?
#2296 by Alexander
30 Dec 2015, 19:39
aimeos wrote:Are both languages active in the admin interface (Locale tab -> Language sub-tab)?

Yes, they are. And the e-mails are sent in the correct language in dependence of the selected language in the ordering process.

aimeos wrote:Can you try sending e-mails with the Extbase task for a quick test?

I have just tried. As by sending with the aimeos-task the correct language is used. But unfortunately for TypoScript there is only an input-field not a textarea. That's why I can't paste the TypoScript code for translation there.

By the way: There's an interesting difference between the two methods sending e-mails. Sending with Extbase gives a nice HTML-mail but the Aimeos task does not - almost all of the formatting except line breaks is not visible at least in Thunderbird. That's why I wanted to use simple text.
#2297 by aimeos
31 Dec 2015, 12:37
Alexander wrote:I have just tried. As by sending with the aimeos-task the correct language is used. But unfortunately for TypoScript there is only an input-field not a textarea. That's why I can't paste the TypoScript code for translation there.


Well, you can paste the code into the input field. It doesn't display nicely but it should work even if the TYPO3 Extbase command controller doesn't offer text area fields.

Alexander wrote:By the way: There's an interesting difference between the two methods sending e-mails. Sending with Extbase gives a nice HTML-mail but the Aimeos task does not - almost all of the formatting except line breaks is not visible at least in Thunderbird. That's why I wanted to use simple text.


Then you didn't enter a valid path to the theme files. The Extbase command controller uses "typo3conf/ext/aimeos/Resources/Public/Themes/elegance" by default. We added some code that this will be also set by default in the e-mail scheduler in the future.

The problem with the missing e-mail translation was a misnamed variable. We've fixed that in the git repository and it will be part of the next minor release.