Jump to content

Relative path in module admin controller for mail::send


Recommended Posts

I am having problems calling a email template.  In mymodule/admin/mycontroller.php I run this code 

 

	        Mail::Send(
	            1,
	            'free-product',
	            Mail::l('Free Product!', 1),
	            $templateVars,
	            $customer['email'],
	            $customer['firstname'].' '.$customer['lastname'],
				strval(Configuration::get('PS_SHOP_EMAIL')), 
				strval(Configuration::get('PS_SHOP_NAME')),
	            null,
	            null, dirname(__FILE__).'/../../mails/'
	        );

This code returns Error - The following e-mail template is missing: ....... /modules/mymodule/controllers/admin/../../mails/en/free-product.html

I run the same code in mymodule/front/mycontroller.php and it works fine.  Any ideas why this is not working on admin controller? Is there another way to get that tpl path?

Link to comment
Share on other sites

  • 4 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...