This repository has been archived by the owner on Aug 21, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Bruno Meilick <[email protected]>
- Loading branch information
Showing
8 changed files
with
129 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
label: Schedule Date UTC | ||
type: date | ||
#default: today | ||
width: 1/2 | ||
format: YYYY-MM-DD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
label: Schedule Time UTC | ||
type: time | ||
#default: now | ||
width: 1/2 | ||
help: <a target="_blank" href="https://www.timeanddate.com/worldclock/timezone/utc">Current Time at UTC</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# global def | ||
label: Sender | ||
type: select | ||
width: 1/1 | ||
# URL to route needs to be hardcoded if you use kirby version < 2.4.2 | ||
# https://github.com/getkirby/panel/issues/1035 | ||
options: http://YOUR_DOMAIN_HERE/kirby-mailjet/PLUGIN_HASH_HERE/json/senders.json | ||
# since kirby version 2.4.2 | ||
#options: url | ||
#url: kirby-mailjet/PLUGIN_HASH_HERE/json/senders.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,8 @@ But if you have your own toolchain to create responsive HTML code for emails you | |
- add attachements to emails | ||
- add and remove Contacts from Contactslists | ||
- test and publish Newsletters | ||
- publish Newsletters on a Schedule | ||
- choose Mailjet Sender Adress | ||
- Panel Fields to access Contactslists and Segments | ||
- Panel Buttons to send tests and publish (Kirby Opener required) | ||
- example how to create responsive HTML emails | ||
|
@@ -146,6 +148,10 @@ if(KirbyMailjet::sendMail($params)){ | |
$senderEmail = KirbyMailjet::senderAdress(); | ||
// or | ||
$senderEmail = KirbyMailjet::senderAdress('[email protected]'); | ||
// or | ||
if ($page->mjsender()->isNotEmpty()) { | ||
$senderEmail = $page->mjsender()->value(); | ||
} | ||
|
||
// the subject is most important since that will be used | ||
// to identify your Newsletter in combination with | ||
|
@@ -193,6 +199,7 @@ KirbyMailjet::sendNewsletter( | |
$campaign_body, | ||
$campaign_content, | ||
'[email protected]', // email-adress to send test to or string 'Publish' | ||
$schedule, // `null`/`'now'`, a timestamp or an ISO 8601 formatted date (`date('c')`) at UTC | ||
); | ||
|
||
// you can enable logging in config file like this | ||
|
@@ -203,6 +210,18 @@ if(KirbyMailjet::hasErrors()) { | |
} | ||
``` | ||
|
||
**schedule timezone convert example** | ||
```php | ||
$schedule = null; | ||
if ($page->mjscheduledate()->isNotEmpty() && $page->mjscheduletime()->isNotEmpty()) { | ||
$schedule = $page->mjscheduledate()->value() . 'T'. $page->mjscheduletime() . ':00'; | ||
$date = new \DateTime($schedule, new \DateTimeZone('Europe/Berlin')); | ||
$date->setTimezone(new \DateTimeZone('UTC')); | ||
$schedule = $date->format(\DateTimeInterface::ISO8601); | ||
} | ||
|
||
``` | ||
|
||
## Responsive HTML Emails Example | ||
|
||
You can find the [example readme here](https://github.com/bnomei/kirby-mailjet/blob/master/example.md). | ||
|