-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Poslání e-mailu s fakturou zavoláním jedné funkce.
- Loading branch information
Showing
8 changed files
with
105 additions
and
28 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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?php | ||
|
||
include(__DIR__.'/config.php'); | ||
|
||
$vyfakturuj_api = new VyfakturujAPI(VYFAKTURUJ_API_LOGIN,VYFAKTURUJ_API_KEY); | ||
|
||
# | ||
# | ||
#################################################################################### | ||
#################################################################################### | ||
##### ##### | ||
##### Získání mailu (pro kontrolu) ##### | ||
##### ##### | ||
#################################################################################### | ||
#################################################################################### | ||
# | ||
# | ||
|
||
$opt = array(// šablona, kterou si přejeme odeslat | ||
'type' => 3, | ||
'to' => '[email protected]',// lze také použit tento zápis: '[email protected], [email protected]' | ||
// 'cc' => '', | ||
// 'bcc' => '', | ||
// 'subject' => 'Testovací subjekt', | ||
// 'body' => '.. zde by byl text e-mailu, ktery chceme odeslat ...', | ||
'pdfAttachment' => true,// chceme poslat včetně PDF v příloze | ||
); | ||
|
||
$res = $vyfakturuj_api->invoice_sendMail_test(54525,$opt); // Získáme šablonu, co by se odeslalo | ||
|
||
echo '<h2>Tento mail by se odeslal:</h2>'; | ||
echo '<pre>'.print_r($res,true).'</pre>'; | ||
|
||
|
||
# | ||
# | ||
#################################################################################### | ||
#################################################################################### | ||
##### ##### | ||
##### Skutečné odeslání e-mailu ##### | ||
##### ##### | ||
#################################################################################### | ||
#################################################################################### | ||
# | ||
# | ||
//die('<font color="red">Zakomentujte řádek '.__LINE__.' pokud chcete e-mail skutečně odeslat.</font>'); // tento řádek zakomentujte a mail se skutečně odešle. | ||
|
||
$res = $vyfakturuj_api->invoice_sendMail(54525,$opt); // Odešleme e-mail | ||
|
||
echo '<h2>Tento e-mail byl odeslán:</h2>'; | ||
echo '<pre>'.print_r($res,true).'</pre>'; | ||
|
||
exit; |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
1) V souboru /inc/inc.php doplnit potřebné údaje | ||
2) Spustit 1-test.php a otestovat připojení na server (musí se zobrazit welcome zpráva s datumem) | ||
3) V souboru 2-invoice.php se nachází ukázka, jak vytvářet, updatovat, získávat a mazat faktury | ||
4) V souboru 3-contact.php se nachází ukázka, jak vytvářet, updatovat, získávat a mazat kontakty | ||
5) V souboru 4-template.php se nachází ukázka, jak vytvářet, updatovat, získávat a mazat pravidelné faktury a šablony |