Commit e6ea2d9e authored by Kevin Ditscheid's avatar Kevin Ditscheid
Browse files

[TASK] Update the readme

parent 86cb636d
......@@ -114,10 +114,13 @@ $mailService->setIgnoreMailQueue(TRUE);
$mailService->setPid(123);
// set the proper language for the mail (not necessary if you want the default language)
$mailService->setLanguage($GLOBALS['TSFE']->config['config']['language']);
$mailService->setSiteLanguage(GeneralUtility::makeInstance(SiteFinder::class)->getSiteByPageId(123)->getLanguageById(0));
// finally send the mail
$mailService->sendEmail();
$success = $mailService->sendEmail();
if (!$success) {
// the mail sending failed
}
```
### The mail queue
......@@ -148,8 +151,7 @@ For more information on the TYPO3 scheduler extension read its [manual](https://
## Language handling
When you provide no language to the MailService API, the default language of the TYPO3 instance is used.
This happens also if the given iso code of the language is not known (inside the **sys_lang** table).
When using the MailTemplateService API, you need to provide an instance of `SiteLanguage` to the API either by setting it via `setSiteLanguage` or by loading values from a `Template` instance which has the `SiteLanguage` set.
In your template editor you automatically have all languages of your page shown.
......@@ -241,10 +243,6 @@ If the page ids are missing or not correspond to a site root, the configuration
### Searching for emails from blacklisted templates
In the backend module mode "Queue" you can filter for "Blacklisted" mails. Note: you shouldn't select a template filter to see the blacklisted mails.
## Known Facts
### Countries aren't respected yet. Currently, just languages are used.
## Developer Guide
### Database and Models
......@@ -258,6 +256,7 @@ This extension uses two database tables:
When they are sent, the flag **sent** is set to true, and the **sending_time** is inserted.
You can inspect the mailing queue with the backend module.
If an email should ignore the mail queue, it is still inserted in this table with the **sent** flag set to true.
The mails have a status associated to them. If a mail fails to submit, the status will be set to error and the error message is saved in the error_message field so you can review it for the individual mail.
The extbase model classes for these tables are located at the *Domain\Model* folder.
......@@ -271,18 +270,20 @@ Here is an overview of some important functions:
###### function getDefaultTemplateMarker
Reads custom example template marker from your **locallang.xlf**. This is only useful if you need multi language examples in your Backend Marker
###### function loadPredefinedValuesForTemplate
Sets the predefined values for this template that have been supplied by the editor. Use this method if you have no custom values for
cc, bcc, replyTo, fromMail and fromName. Returns **false** if the template & extension key combination was not found.
###### function sendEmail
Sends your mail or adds it to the mailing queue, depending on the settings. You can specify in with the boolean parameter if the preview values should be used or not.
###### function sendMailFromQueue
Forces the sending of an E-Mail from within the queue. If it has already been sent, it gets send again.
###### function getMailMessage
You can get the instance of **\TYPO3\CMS\Core\Mail\MailMessage** that is internally used by the service, if you want a more direct interaction with the mail object.
###### function sendMailsFromQueue
Same as sendMailFromQueue, but this method accepts an array of `Mail` instances instead of the uid of one `Mail`.
###### function addFileResourceAttachment
You can attach a file resource to the mail that will be sent via the markers array.
###### function addMailToMailQueue
Add the currently built mail to the mail queue
###### functions setX
Sets the various variables to the supplied values. With these functions you can overwrite for instance from/cc/bcc Adresses, from name etc.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment