# Email versand  Fatal error: \_\_clone method called on non-obj

**URL:** <https://forum.shopware.com/t/email-versand-fatal-error-clone-method-called-on-non-obj/12704>\
**Category:** Shopware 3.5\
**Tags:** programming\
**Created:** [15. April 2013 um 10:43 UTC](https://forum.shopware.com/t/email-versand-fatal-error-clone-method-called-on-non-obj/12704 "2013-04-15T10:43:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kurzi](https://avatars.discourse-cdn.com/v4/letter/k/aca169/32.png) [@kurzi](https://forum.shopware.com/u/kurzi)\
**Post date:** [15. April 2013 um 10:43 UTC](https://forum.shopware.com/t/email-versand-fatal-error-clone-method-called-on-non-obj/12704/1 "2013-04-15T10:43:39Z")

</div>

Hallo Community, wie der Betreff schon sagt bekomme ich einen Fatal Error beim versand einer Email während eines CronJob aufrufes. `$template = clone Shopware()-\>Config()-\>Templates-\>{"Vorlage"};` dies ist die stelle. Die Vorlage ist erstellt und wenn ich eine Testmail im Backend an mich versende wird diese auch versendet. Nur beim CronJob aufruf bekomme ich diesen Fehler. Hat dieses Problem vll schon jemand gehabt? Viele Grüße kurzi

---

<div class="post-metadata">

**Author:** ![Stefan\_Hamann](https://avatars.discourse-cdn.com/v4/letter/s/5e9695/32.png) [@Stefan\_Hamann](https://forum.shopware.com/u/Stefan_Hamann)\
**Post date:** [16. April 2013 um 08:40 UTC](https://forum.shopware.com/t/email-versand-fatal-error-clone-method-called-on-non-obj/12704/2 "2013-04-16T08:40:58Z")

</div>

Hallo, ein Beispiel für den Mailversand aus einem Cronjob heraus, findest du im CronBirthday Plugin. ` // Assign variables $variables = array("var1"=\>"value1"); // Create Mail-Template $mail = Shopware()-\>TemplateMail()-\>createMail('VORLAGE', $variables); $mail-\>addTo($user['email']); $mail-\>send(); `
