<?php
/**
 * 2007-2023 PrestaShop
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@prestashop.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
 * versions in the future. If you wish to customize PrestaShop for your
 * needs please refer to http://www.prestashop.com for more information.
 *
 *  @author    PrestaShop SA <contact@prestashop.com>
 *  @copyright 2007-2023 PrestaShop SA
 *  @license   http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 *  International Registered Trademark & Property of PrestaShop SA
 */

namespace PrestaShop\Module\AgileMultisellerPro\Helper\Email;

if (!defined('_PS_VERSION_')) {
    exit;
}

class AgileMailer extends \ObjectModel
{
    public static function sendTranslateSubject($id_lang, $template, $templateVars, $to, $toName = null, $from = null, $fromName = null, $fileAttachment = null, $modeSMTP = null, $templatePath = _PS_MAIL_DIR_, $die = false, $id_shop = null, $bcc = null)
    {
        switch ($template) {
            case 'order_return_request':
                return \Mail::Send(
                    $id_lang,
                    'order_return_request',
                    \Mail::l('Order Return Request', $id_lang),
                    $templateVars,
                    $to,
                    $toName,
                    $from,
                    $fromName,
                    $fileAttachment,
                    $modeSMTP,
                    $templatePath,
                    $die,
                    $id_shop,
                    $bcc
                );
            case 'new_order':
                return \Mail::Send(
                    $id_lang,
                    'new_order',
                    \Mail::l('New Order', $id_lang),
                    $templateVars,
                    $to,
                    $toName,
                    $from,
                    $fromName,
                    $fileAttachment,
                    $modeSMTP,
                    $templatePath,
                    $die,
                    $id_shop,
                    $bcc
                );
            case 'fund_request':
                return \Mail::Send(
                    $id_lang,
                    'fund_request',
                    \Mail::l('Fund request from a seller', $id_lang),
                    $templateVars,
                    $to,
                    $toName,
                    $from,
                    $fromName,
                    $fileAttachment,
                    $modeSMTP,
                    $templatePath,
                    $die,
                    $id_shop,
                    $bcc
                );
            case 'app_selleraccount':
                return \Mail::Send(
                    $id_lang,
                    'app_selleraccount',
                    \Mail::l('Your seller account approved!', $id_lang),
                    $templateVars,
                    $to,
                    $toName,
                    $from,
                    $fromName,
                    $fileAttachment,
                    $modeSMTP,
                    $templatePath,
                    $die,
                    $id_shop,
                    $bcc
                );
            case 'new_selleraccount':
                return \Mail::Send(
                    $id_lang,
                    'new_selleraccount',
                    \Mail::l('Your seller account', $id_lang),
                    $templateVars,
                    $to,
                    $toName,
                    $from,
                    $fromName,
                    $fileAttachment,
                    $modeSMTP,
                    $templatePath,
                    $die,
                    $id_shop,
                    $bcc
                );
            case 'new_selleraccount_admin':
                return \Mail::Send(
                    $id_lang,
                    'new_selleraccount_admin',
                    \Mail::l('A new seller account has been added', $id_lang),
                    $templateVars,
                    $to,
                    $toName,
                    $from,
                    $fromName,
                    $fileAttachment,
                    $modeSMTP,
                    $templatePath,
                    $die,
                    $id_shop,
                    $bcc
                );
            case 'new_product':
                return \Mail::Send(
                    $id_lang,
                    'new_product',
                    \Mail::l('New product approval request', $id_lang),
                    $templateVars,
                    $to,
                    $toName,
                    $from,
                    $fromName,
                    $fileAttachment,
                    $modeSMTP,
                    $templatePath,
                    $die,
                    $id_shop,
                    $bcc
                );
            case 'product_approval':
                return \Mail::Send(
                    $id_lang,
                    'product_approval',
                    \Mail::l('Product Approved', $id_lang),
                    $templateVars,
                    $to,
                    $toName,
                    $from,
                    $fromName,
                    $fileAttachment,
                    $modeSMTP,
                    $templatePath,
                    $die,
                    $id_shop,
                    $bcc
                );
            case 'product_disapproval':
                return \Mail::Send(
                    $id_lang,
                    'product_disapproval',
                    \Mail::l('Product Disapproved', $id_lang),
                    $templateVars,
                    $to,
                    $toName,
                    $from,
                    $fromName,
                    $fileAttachment,
                    $modeSMTP,
                    $templatePath,
                    $die,
                    $id_shop,
                    $bcc
                );
            case 'expiration_reminder':
                return \Mail::Send(
                    $id_lang,
                    'expiration_reminder',
                    \Mail::l('Your membership will expire soon', $id_lang),
                    $templateVars,
                    $to,
                    $toName,
                    $from,
                    $fromName,
                    $fileAttachment,
                    $modeSMTP,
                    $templatePath,
                    $die,
                    $id_shop,
                    $bcc
                );
            case 'subscription_limit_reached':
                return \Mail::Send(
                    $id_lang,
                    $template,
                    \Mail::l('Subscription limit reached', $id_lang),
                    $templateVars,
                    $to,
                    $toName,
                    $from,
                    $fromName,
                    $fileAttachment,
                    $modeSMTP,
                    $templatePath,
                    $die,
                    $id_shop,
                    $bcc
                );
            case 'no_subscription':
                return \Mail::Send(
                    $id_lang,
                    $template,
                    \Mail::l('Subscription not available', $id_lang),
                    $templateVars,
                    $to,
                    $toName,
                    $from,
                    $fromName,
                    $fileAttachment,
                    $modeSMTP,
                    $templatePath,
                    $die,
                    $id_shop,
                    $bcc
                );
            default:
                throw new \Exception(sprintf('Template %s not found', $template));
        }
    }
}
