Giter Site home page Giter Site logo

mailer's People

Contributors

fbraz3 avatar korsar-zn avatar ovr avatar zzplab avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

mailer's Issues

$params variable on createMessageFromView method is not begin send to view

$params = array(
'subject' => 'Password Recovery',
'fullname' => 'Fullname'
);

$this->mailer->createMessageFromView('password_recovery', $params)->to($user[0]['email'], $userInfo->firstname.' '.$userInfo->lastname)->subject('Password Recovery')->send();

so I have temporay fix this issue by add "$view->setVar('params',$params);" before the line number 320 in file name Manager.php

Phalcon\Mvc\View\Exception: View was not found in the views directory

in index.php
/**
* Setting up volt
*/
$di->set('volt', function($view, $di) {

    $volt = new \Phalcon\Mvc\View\Engine\Volt($view, $di);

    $volt->setOptions(array(
        "compiledPath" => "../cache/volt/"
    ));

    return $volt;
}, true);
/**
 * Register the mail service which use Swift library
 */
$di->set('mail', function() {
    $config = new Phalcon\Config\Adapter\Ini(__DIR__ . '/../app/config/mail.ini');
    $mailer = new \Phalcon\Ext\Mailer\Manager(array(
        "driver" => $config->mail->driver,
        "host" => $config->mail->host,
        "port" => $config->mail->port,
        'encryption' => $config->mail->encryption,
        'username' => $config->mail->username,
        'password' => $config->mail->password,
        'from' => array("email" => $config->mail->fromEmail, "name" => $config->mail->fromName)
    ));
    return $mailer;
});

In Model:

public function beforeCreate() {
    $mailer = $this->getDI()->getMail();
    $viewPath = 'emailTemplates/newuser-' . $this->notifyLang . '';

    $message = $mailer->createMessageFromView($viewPath, array('password' => $this->plainpass))
            ->to(array($this->email => $this->rname))
            ->subject('User Registration')
    ;
    $message->send();
}

I Got The Error:

Phalcon\Mvc\View\Exception: View '/var/www/html/new/app/views/emailTemplates/newuser-bg' was not found in the views directory
File=/var/www/html/new/app/vendor/phalcon-ext/mailer/src/Manager.php
Line=312
#0 [internal function]: Phalcon\Mvc\View\Simple->_internalRender('emailTemplates/...', Array)
#1 /var/www/html/new/app/vendor/phalcon-ext/mailer/src/Manager.php(312): Phalcon\Mvc\View\Simple->render('emailTemplates/...', Array)
#2 /var/www/html/new/app/vendor/phalcon-ext/mailer/src/Manager.php(106): Phalcon\Ext\Mailer\Manager->renderView('emailTemplates/...', Array, '/var/www/html/n...')
#3 /var/www/html/new/app/models/Staff.php(37): Phalcon\Ext\Mailer\Manager->createMessageFromView('emailTemplates/...', Array, '/var/www/html/n...')
#4 [internal function]: Staff->beforeCreate()
#5 [internal function]: Phalcon\Mvc\Model->fireEventCancel('beforeCreate')
#6 [internal function]: Phalcon\Mvc\Model->_preSave(Object(Phalcon\Mvc\Model\MetaData\Memory), false, 'id')
#7 [internal function]: Phalcon\Mvc\Model->save()
#8 /var/www/html/new/app/controllers/StaffController.php(233): Phalcon\Mvc\Model->create()
#9 [internal function]: StaffController->createAction()
#10 [internal function]: Phalcon\Dispatcher->dispatch()
#11 /var/www/html/new/public/index.php(288): Phalcon\Mvc\Application->handle()
#12 {main}

I have checked many times that the view is there. when i do something like
nano /var/www/html/new/app/views/emailTemplates/newuser-bg.volt I have open the view in editor.

I can't understand why Phalcon\Mvc\View thinks that It is not there.

Could you help me with this issue.

Mailer\Manager construct request

Hi I would to know if It's will be a possibility to pass a Phalcon Config object in the construct.

  • the construct param is mandatory (the readme says it's optionnal and use the default viewsDir)
    It should take the getViewsDir() by default, and the params is not mandatory.

thanks for the module though, really helpful

createEmbedViaData

Not sure, but I think /src/Message.php createEmbedViaData() method is missing the $contentType parameter. At least, it didn't work for me until I added the following changes. I needed to embed contentType = text/calendar, but it wasn't working.

/**
* Create a Swift new Image.
*
* @param string $data
* @param string|null $name optional
* @param string|null $contentType optional
*
* @return \Swift_Image
*
* @see \Swift_Image::newInstance()
*/
protected function createEmbedViaData($data, $name = null, $contentType = null)
{
return $this->getManager()->getDI()->get('\Swift_Image', [$data, $name, $contentType]);
}

Unable to auth using Google Apps

When attempting to auth using a Google Apps gmail account (custom domain), the connection is refused as it not "secure". Attempted both tls and ssl. No issues with standard gmail accounts. Research points to it requiring oauth.

There is a work around available, you can elect to make your account less secure in the settings, but other features may be disabled. Sometimes a reduction in security for a feature is not an option.

Package swiftmailer/swiftmailer is abandoned

When using this package composer give me the warning:

Package swiftmailer/swiftmailer is abandoned, you should avoid using it. Use symfony/mailer instead.

The migration should be pretty simple: https://symfony.com/blog/the-end-of-swiftmailer

Migrating from Swiftmailer to Symfony Mailer is a relatively easy task as the concepts are the same between the two projects.

Are you interested in dropping swiftmailer for symfony/mailer?

Doesn't support Phalcon 4.0+

Hi,
I am using this library with Phalcon 4.0 and above, but unfortunately the following error is thrown:

Class 'Phalcon\Mvc\User\Component' not found

This is easily fixable by changing the use of Phalcon\Mvc\User\Component to Phalcon\Di\Injectable

HTML mail with plain text alternative

Hi,

maybe obvious, but I couldn't find information on this neither in the docs nor in the code:
Is it possible to send HTML formatted mails with a plain text alternative?
If so, could you tell me how?

Thanks in advance.

Problem with createMessageFromView()

Hello, if I try to send an email with template, I receive the email with Subject, but without content(template is not loading).
If I try without template( createMessage() ), is working properly.
Path to template is good...is very wierd.

Swiftmailer v6

The change in master to 'Allow composers use Swiftmailer v6' has not been tagged to a version. This is requiring the use of dev-master in order to install the package.

This is causing an issue with my company's rules about usage of stable versions of third party packages as they are requiring SwiftMailer 6 for security reasons.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.