THELIA Forum

Welcome to the THELIA support and discusssion forum

Announcement

Rejoignez la communauté sur le Discord Thelia : https://discord.gg/YgwpYEE3y3

Offline


Encore moi pour mon appli.

Comment créer en programmant un message ayant le code 'order_seller_notification' qui appellerais le template email 'order_seller_notification' ?

Offline


Un message qui appelle un template email ??


OpenStudio Toulouse

Offline


Oui, avec un code comme ça :

public function sendSellerNotificationEmail(SellerNotificationAmpSellerOrder $sellerOrder, $type = NULL) {

// Sending notification to sellers
        $ampSellerQuery = new AmpSellerQuery();
        $ampSeller = $ampSellerQuery->findOneById($sellerOrder->getAmpSellerId());

        $this->mailer->sendEmailMessage(
                'order_notification', [ConfigQuery::getStoreEmail() => ConfigQuery::getStoreName()], [$ampSeller->getEmail() => $ampSeller->getTitle()], [
            'order_id' => $sellerOrder->getId(),
            'order_ref' => $sellerOrder->getSellerOrderRef(),
            'type' => $type,
                ]
        );
    }

Il y a des templates pour les emails dans templates/email/mmes supertemplatesperso ou default de base.

Last edited by GillesL (13-09-2018 13:37:08)

Offline


Je viens de découvrir les tables "message" et "message_i18n"... Je vais voir pour les remplir avec les bonnes infos à l'activation du module.