Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
sg_mail
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TYPO3
sg_mail
Commits
bd1aa0a1
Commit
bd1aa0a1
authored
8 years ago
by
Paul Ilea
Browse files
Options
Downloads
Patches
Plain Diff
[TASK] Added Documentation
parent
deff811f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+70
-0
70 additions, 0 deletions
README.md
with
70 additions
and
0 deletions
README.md
0 → 100644
+
70
−
0
View file @
bd1aa0a1
# sg_mail
This extension provides an email templating service and mail queue for other extensions.
Templates in various languages can be managed in the backend. Additionally sg_mail provides a finisher class
for the Formhandler extension, making it possible to manage formhandler templates in the backend.
## Registering your Extension/Plugin
To integrate sg_mail available for your extension, you have to register it inside your
**ext_localconf.php**
by supplying a path string to an implementation of
**SGalinski\SgMail\Service\RegisterInterface**
with:
*
your extension key
*
a name for the template
*
the path to your default template files (template files should be named
*language_code*
.template.html. Example: en.template.html)
*
a brief description of the template (when is it used ?)
*
the template markers(placeholder variables)
*
the subjects for all templates. Here you have to use an associative array language_code => subject
### Example :
An example class can be found here:
**SGalinski\SgMail\Example\Register**
Register your class in
**ext_localconf.php**
with:
```
\SGalinski\SgMail\Service\MailTemplateService::registerByFile('SGalinski\SgMail\Example\Register');```
### Send an email with the MailTemplateService
Basic Usage:
1. Get an instance of MailTemplateService
2. Set all desired fields (i.e. setLanguage, setToAddresses, setTemplateName, setExtensionKey etc.)
3. Invoke the **sendEmail()** function
You can also set the priority (setPriority function of the service) for your mails with the constants
of the **SGalinski\SgMail\Domain\Model\Mail** class. With the Flag **ignoreMailQueue** you can switch between
queueing your Mail(false) or immediately(true) sending it.
* PRIORITY_LOWEST
* PRIORITY_LOW
* PRIORITY_MEDIUM
* PRIORITY_HIGH
* PRIORITY_HIGHEST
The higher the priority, the more likely the mail will get send immediately (depending how "busy" the MailQueue is).
## Using sg_mail with Formhandler
In your **setup.ts** of your formhandler extension, you have to invoke the **FormhandlerFinisherService** of sg_mail.
This is done in a similar fashion as with the usual finisher classes.
### Example of sg_formhandler_ordercard
```
finishers {
# Finisher_Mail sends emails to an admin and/or the user.
1 {
class = SGalinski
\S
gMail
\S
ervice
\F
ormhandlerFinisherService
config {
checkBinaryCrLf = message
template_key = order_card_admin
extension_key = sg_formhandler_ordercard
to_address = admin@sgalinski.de
from_address = info@sgalinski.de
from_name = sgalinski.de
ignore_mail_queue = TRUE
}
}
}
```
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment