Giter Club home page Giter Club logo

module-email's Introduction

Email

Magento2 module for email providers integration.

example

Following email services are supported:

  • Amazon SES
  • Gmail
  • Mandrill
  • Sendmail
  • Manual SMTP settings

Installation

Run the following commands:

cd <magento_root>
composer require swissup/module-email
bin/magento module:enable Swissup_Email
bin/magento setup:upgrade
bin/magento setup:di:compile

Usage

  1. Navigate to "Marketing → Communications → Email Services" example1
  2. Press "Add New" button
  3. Create service
    • Specify the Name
    • Choose Type from drop-down
    • Fill all required fields
    • Press "Check Service" button and wait for response
    • If everything works fine, press "Save" button example
  4. Navigate "Stores → Configurations → Advanced → System → Mail Sending Settings"
  5. Select new service in the "Default Transport Email Service" drop-down config
  6. Save

Gmail Service Setup

If Type selects Gmail. Use an App Password: Generate a new App Password for your Gmail account. Sign in with App Passwords

Gmail API with Google OAuth 2.0 Support Service Setup

If the Type field is set to Gmail OAuth 2.0, please follow the Google instructions to create the required credentials. In your credentials, you need to add Authorized redirect URIs with at least one URI, such as https://localhost/swissup_oauth2client/google/getToken/ (replace localhost with your Magento store URL). Gmail OAuth2 Credential

Customize the User Consent Screen

In the OAuth consent screen, you need to enable the Gmail API scope. Add Scope. Also, add your Gmail email address as a Test User. After setting up your credentials, enter the following fields:

  • Client ID in User (key)
  • Client secret in Password (secure key)

In the Email (from) field, enter your Gmail email address.

Logging

  1. Navigate "Stores → Configurations → Advanced → System → Mail Sending Settings"
  2. "Logging Enable" set Yes
  3. Navigate to "Marketing → Communications → Email Logs"

I recently needed to modify the emails that a client project sends out. It was set up to send via SMTP and so the easiest way to do this for me was to add a local MailHog instance and point the application at it.

Manually running via Docker The quickest and easiest way to do this is via Docker.

Manually, we can do:

$ docker run -p 8025:8025 -p 1025:1025 mailhog/mailhog

This will run MailHog with the SMTP port exposed on localhost port 1025 and the web interface on 8025.

Now you can configure the app’s SMTP config and away you go.

Option Value
Type Smtp
Host 0.0.0.0 or mailhog
Port 1025
Auth Type None
Secure None

module-email's People

Contributors

0m3r avatar bohdanchumak avatar ci-swissuplabs avatar gwharton avatar peterchmeruk avatar roma84 avatar ryantfowler avatar vovayatsyuk avatar wilfriedwolf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

module-email's Issues

transactional emails won't be sent

When order is placed no message will ne sent.
When I comment an order in backend I receive this popup:
Zend\Mail\Transport\Smtp transport expects either a Sender or at least one From address in the Message; none provided

No records on Email Logs

"Contact us" works normally

magento 2.3.0
Swissup_Email just updated. previous version did the same

Still "eating" Umlauts...

If there is an umlaut in the From, Reply-To or To header Umlauts will not be encoded as they should be.
I'll post a Pull Request right away.

Best Regards,

Willi

Check service' option isn`t working.

Test environments Used:

Magento ver. 2.4.1 Community Edition (PHP 7.4.10)
Magento ver. 2.4.1 Enterprise Edition (PHP 7.4.10)

Reason for failure:

  1. 'Check service' option isn`t working. "There has been an error processing your request" the error message is displayed

Steps:

  1. Go to Marketing -> Communications -> Email Services
  2. Press the “Add new” button
  3. Create service
  4. Click the 'Save and Continue' button
  5. Click the 'Check service' button

ER: The service is checked successfully.

AR: The error message is displayed. "There has been an error processing your request"

Was found on Magento version(s):

Magento ver. 2.4.1 Community Edition (PHP 7.4.10)
Magento ver. 2.4.1 Enterprise Edition (PHP 7.4.10)

Version of browser:
Version 85.0.4183.102 (Official Build) (64-bit)

Video: https://bluejeans.com/s/eoV8IlFRlVm/

Class "Zend\Mail\Header\HeaderValue" not found

Magento 2.4.6-p4 php 8.1

https://github.com/swissup/module-email/blob/master/Mail/Message/Convertor.php#L46

Error: Class "Zend\Mail\Header\HeaderValue" not found in /home/usams/public_html/vendor/swissup/module-email/Mail/Message/Convertor.php:46
Stack trace:
#0 [internal function]: Swissup\Email\Mail\Message\Convertor->Swissup\Email\Mail\Message\{closure}()
#1 /home/usams/public_html/vendor/swissup/module-email/Mail/Message/Convertor.php(50): array_map()
#2 /home/usams/public_html/vendor/swissup/module-email/Mail/Transport.php(109): Swissup\Email\Mail\Message\Convertor->fromMessage()
#3 /home/usams/public_html/vendor/magento/framework/Interception/Interceptor.php(58): Swissup\Email\Mail\Transport->sendMessage()
#4 /home/usams/public_html/vendor/magento/framework/Interception/Interceptor.php(138): Swissup\Email\Mail\Transport\Interceptor->___callParent()
#5 /home/usams/public_html/vendor/swissup/module-gdpr/Plugin/MailTransport.php(49):
Swissup\Email\Mail\Transport\Interceptor->Magento\Framework\Interception\{closure}()
#6 /home/usams/public_html/vendor/magento/framework/Interception/Interceptor.php(135): Swissup\Gdpr\Plugin\MailTransport->aroundSendMessage()
#7 /home/usams/public_html/vendor/magento/module-email/Model/Mail/TransportInterfacePlugin.php(48):
Swissup\Email\Mail\Transport\Interceptor->Magento\Framework\Interception\{closure}()
#8 /home/usams/public_html/vendor/magento/framework/Interception/Interceptor.php(135): Magento\Email\Model\Mail\TransportInterfacePlugin->aroundSendMessage()
#9 /home/usams/public_html/vendor/magento/framework/Interception/Interceptor.php(153):
Swissup\Email\Mail\Transport\Interceptor->Magento\Framework\Interception\{closure}()
#10 /home/usams/public_html/generated/code/Swissup/Email/Mail/Transport/Interceptor.php(23): Swissup\Email\Mail\Transport\Interceptor->___callPlugins()
#11 /home/usams/public_html/vendor/swissup/module-email/Controller/Adminhtml/Email/Service/Check.php(125): Swissup\Email\Mail\Transport\Interceptor->sendMessage()
#12 /home/usams/public_html/vendor/magento/framework/Interception/Interceptor.php(58): Swissup\Email\Controller\Adminhtml\Email\Service\Check->execute()
#13 /home/usams/public_html/vendor/magento/framework/Interception/Interceptor.php(138):
Swissup\Email\Controller\Adminhtml\Email\Service\Check\Interceptor->___callParent()
#14 /home/usams/public_html/vendor/magento/framework/Interception/Interceptor.php(153):
Swissup\Email\Controller\Adminhtml\Email\Service\Check\Interceptor->Magento\Framework\Interception\{closure}()
#15 /home/usams/public_html/generated/code/Swissup/Email/Controller/Adminhtml/Email/Service/Check/Interceptor.php(23):
Swissup\Email\Controller\Adminhtml\Email\Service\Check\Interceptor->___callPlugins()
#16 /home/usams/public_html/vendor/magento/framework/App/Action/Action.php(111): Swissup\Email\Controller\Adminhtml\Email\Service\Check\Interceptor->execute()
#17 /home/usams/public_html/vendor/magento/module-backend/App/AbstractAction.php(151): Magento\Framework\App\Action\Action->dispatch()
#18 /home/usams/public_html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Backend\App\AbstractAction->dispatch()
#19 /home/usams/public_html/vendor/magento/framework/Interception/Interceptor.php(138):
Swissup\Email\Controller\Adminhtml\Email\Service\Check\Interceptor->___callParent()
#20 /home/usams/public_html/vendor/magento/module-backend/App/Action/Plugin/Authentication.php(145):
Swissup\Email\Controller\Adminhtml\Email\Service\Check\Interceptor->Magento\Framework\Interception\{closure}()
#21 /home/usams/public_html/vendor/magento/framework/Interception/Interceptor.php(135): Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch()
#22 /home/usams/public_html/vendor/magento/framework/Interception/Interceptor.php(153):
Swissup\Email\Controller\Adminhtml\Email\Service\Check\Interceptor->Magento\Framework\Interception\{closure}()
#23 /home/usams/public_html/generated/code/Swissup/Email/Controller/Adminhtml/Email/Service/Check/Interceptor.php(32):
Swissup\Email\Controller\Adminhtml\Email\Service\Check\Interceptor->___callPlugins()
#24 /home/usams/public_html/vendor/magento/framework/App/FrontController.php(245): Swissup\Email\Controller\Adminhtml\Email\Service\Check\Interceptor->dispatch()
#25 /home/usams/public_html/vendor/magento/framework/App/FrontController.php(212): Magento\Framework\App\FrontController->getActionResponse()
#26 /home/usams/public_html/vendor/magento/framework/App/FrontController.php(147): Magento\Framework\App\FrontController->processRequest()
#27 /home/usams/public_html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\FrontController->dispatch()
#28 /home/usams/public_html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\App\FrontController\Interceptor->___callParent()
#29 /home/usams/public_html/vendor/magento/framework/Interception/Interceptor.php(153):
Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}()
#30 /home/usams/public_html/generated/code/Magento/Framework/App/FrontController/Interceptor.php(23):
Magento\Framework\App\FrontController\Interceptor->___callPlugins()
#31 /home/usams/public_html/vendor/magento/framework/App/Http.php(116): Magento\Framework\App\FrontController\Interceptor->dispatch()
#32 /home/usams/public_html/vendor/magento/framework/App/Bootstrap.php(264): Magento\Framework\App\Http->launch()
#33 /home/usams/public_html/pub/index.php(30): Magento\Framework\App\Bootstrap->run()
#34 {main}

Prevent "Service Check" exception fails

Test environments Used:

Magento ver. 2.4.1 Community Edition (PHP 7.4.10)
Magento ver. 2.4.1 Enterprise Edition (PHP 7.4.10)

Steps:

  1. Go to Admin and enable the module.
  2. Go to Marketing > Communications > Email Services and click on the "Add New" button.
  3. Click on the "Check Service" button.

Expected result: The button must work correctly.

Actual result: Appears an error

Was found on Magento version(s):

Magento ver. 2.4.1 Community Edition (PHP 7.4.10)
Magento ver. 2.4.1 Enterprise Edition (PHP 7.4.10)

The version of the browser:
Google Chrome Version 80.0.3987.132 (Official Build) (64-bit)

Video: https://bluejeans.com/s/w@y6wRKlcJ3
Logs: Yes

Amazon SES Region Option

I think there should be a way to define the amazon region on configuration page
email/Model/Transport/Ses.php

Password is truncated

Preconditions

This issue has been confirmed on multiple Magento 2.4.4+ with the plugin version 0.5.8

Describe the problem

When we try to register a Sendgrid Api Key the password is truncated in the database

Steps to reproduce:

  1. create a sendgrid API key (or use a 69 chars password)
  2. register a service using this 69+ chars password
  3. the service is saved but password does not appears anymore

Expected result

the full encrypted password should be stored in database

Actual result

only the first chars are registered (truncate by the column size limit)

Has the world evolves to longer API keys the password column should be at least 255 chars or converted to text field

Mandrill Renders all HTML Emails with HTML Tags

When using this extension with Mandrill all HTML emails are sent with the HTML tags inline and the emails are impossible to read. Initially, we though this was due to settings in Mandrill for HTML emails, but we played around with all the Mandrill settings and nothing worked. The extension is unusable with Mandrill because the emails are delivered as text emails with HTML tags included, which makes them impossible read. Notably, when switching back to the regular Magento core email setup, the emails display fine. A simple code like this will display exactly like this when send email via Mandrill with this plugin:
<p><strong>Your Order</strong></p>

This is actually what the customer sees. The HTML tags.

Poor performance when having a larga email history

Hi,

I've been using this module for a year now, it is great.

However, I've found that there is a poor performance when the number of emails in history is large (near 100000).

I've solved this, adding an index to the table in the following way:
ALTER TABLE swissup_email_history ADD INDEX created_entity_ndx (created_at,entity_id);

No Auth option

Is it possible to get support for no authentication.

Google's mail relay has the option of setting up authentication by IP address of server, so no need to store smtp account password in Magento.

Would be great to see this added to the Auth list.

Circumvent SMTP-Servers rejecting EHLO/HELO localhost

Hi there,

in a shop we use, the E-Mails (all of a sudden) got rejected because of the above message, using localhost rather than a fqdn.
So it would be nice, to be able to configure the host in a way to circumvent this.

Best regards,

Willi

I can't install this 0.6.2 version, it has an exception prompt

I tried installing this new 0.6.2 version but I got an exception

Warning: Undefined array key "swissup_oauth_client_access_token" in /public_html/vendor/magento/framework/Setup/Declaration/Schema/Declaration/SchemaBuilder.php on line 354

I checked the code and it seems to be because of this line of code inside the /etc/db_schema.xml file

constraint xsi:type="foreign" referenceId="SWISSUP_EMAIL_TOKEN_ID_SWISSUP_OAUTH_CLIENT_ACCESS_TOKEN_ID" table="swissup_email_service" column="token_id" referenceTable="swissup_oauth_client_access_token" referenceColumn="id" onDelete="SET NULL"

I didn't find this swissup_oauth_client_access_token table, the new version doesn't seem to include it?

Email Logs column 'from' sorting mysql error

Test Environments Used:
Magento ver. 2.4.1 Enterprise Edition (PHP 7.4.10)
Magento ver. 2.3.6 Community Edition (PHP 7.3.22)

Reasons for failure:
Infinite loading and an error appear \ "Something went wrong." \ on the page \ "Marketing → Communications → Email Logs" \ after sorting by column "From"\

Steps:

  1. Install Magento with this extension
  2. Go to Magento Admin Panel → Marketing → Communications → Email Logs
  3. Click to sort by column " From"\

Expected result:
Sorting by the column " From"\working correctly

Actual result:
Infinity load after using sorting by the column " From". An error appears " Something went wrong". The browser console error. Please, see attached file.

Was found on Magento version(s) + PHP version(s):
Magento ver. 2.4.1 Enterprise Edition (PHP 7.4.10)
Magento ver. 2.3.6 Community Edition (PHP 7.3.22)

Extension fails automatic tests on Marketplace

PHP Fatal error: Allowed memory size of 2147483648 bytes exhausted (tried to allocate 4096 bytes) in phar:///usr/bin/composer/src/Composer/DependencyResolver/Solver.php on line 223

Fatal error: Allowed memory size of 2147483648 bytes exhausted (tried to allocate 4096 bytes) in phar:///usr/bin/composer/src/Composer/DependencyResolver/Solver.php on line 223

Any idea?

Screenshot_2020-11-11 Magento Marketplace - Developer Portal

Magento 2.2.4 breaks compilation

Repositories code generation... 1/7 [====>-----------------------] 14% < 1 sec 52.0 MiBPHP Fatal error: Class Swissup\Email\Model\Transport\Smtp contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Magento\Framework\Mail\TransportInterface::getMessage) in /var/www/webshop/vendor/swissup/email/Model/Transport/Smtp.php on line 9

Email log

We received request to add email logs feature into our extension.

Gmail "check service" Extension rejected from marketplace

Review Results:

Test environments used:

Magento ver. 2.4.1 Commerce on Cloud (PHP 7.4.9)
Magento ver. 2.3.6 Commerce on Cloud (PHP 7.3.21)

Reasons for failure:

Something went wrong while checking the service

Summary:

Steps:

  1. Go to Marketing > Communications > Email Services
  2. Click "Add New" button and save.
  • Name: Gmail
  • Type: Gmail
  1. Select "Default Transport Email Service": Gmail
  2. Click on the "Check Service" button.

Expected result: page opens without any errors

Actual result: Something went wrong while checking the service. Original error message : 5.7.14 5.7.14 Please log in via your web browser and then try again. 5.7.14 Learn more at 5.7.14 https://support.google.com/mail/answer/78754 q188sm2901152pfc.204 - gsmtp
Please, see attached file

Was found on Magento version: Magento ver. 2.4.1 Commerce on Cloud,
Full PHP Version: PHP 7.4.9

Was found on Magento version: Magento ver. 2.3.6 Commerce on Cloud
Full PHP Version: 7.3.21

Version of browser (browsers): Chrome Version 77.0.3865.90 (Official Build) (64-bit)

Video: https://bluejeans.com/s/FCokh3myzsH/
09d6fc8cd0a59ce8062fa12759a529cf.zip

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.