Sales Emails going via wrong email address magento 2.2.x
I have setup email address in sales representative but getting sales email from
apache@domainname
So where I need to fix this issue? Can anyone let me know?
Other emails except sales are working fine.
magento2 email order-email sales magento2.2.4
add a comment |
I have setup email address in sales representative but getting sales email from
apache@domainname
So where I need to fix this issue? Can anyone let me know?
Other emails except sales are working fine.
magento2 email order-email sales magento2.2.4
1
Please check my ans, as I had same issue before and I have solved it.
– Aasim Goriya
Sep 8 '18 at 6:10
Okay, I am trying.
– Vinod Kumar
Sep 8 '18 at 6:13
ok please let me know if anything
– Aasim Goriya
Sep 8 '18 at 6:40
add a comment |
I have setup email address in sales representative but getting sales email from
apache@domainname
So where I need to fix this issue? Can anyone let me know?
Other emails except sales are working fine.
magento2 email order-email sales magento2.2.4
I have setup email address in sales representative but getting sales email from
apache@domainname
So where I need to fix this issue? Can anyone let me know?
Other emails except sales are working fine.
magento2 email order-email sales magento2.2.4
magento2 email order-email sales magento2.2.4
edited Dec 12 '18 at 5:16
Aasim Goriya
2,6711734
2,6711734
asked Sep 8 '18 at 4:35
Vinod KumarVinod Kumar
908320
908320
1
Please check my ans, as I had same issue before and I have solved it.
– Aasim Goriya
Sep 8 '18 at 6:10
Okay, I am trying.
– Vinod Kumar
Sep 8 '18 at 6:13
ok please let me know if anything
– Aasim Goriya
Sep 8 '18 at 6:40
add a comment |
1
Please check my ans, as I had same issue before and I have solved it.
– Aasim Goriya
Sep 8 '18 at 6:10
Okay, I am trying.
– Vinod Kumar
Sep 8 '18 at 6:13
ok please let me know if anything
– Aasim Goriya
Sep 8 '18 at 6:40
1
1
Please check my ans, as I had same issue before and I have solved it.
– Aasim Goriya
Sep 8 '18 at 6:10
Please check my ans, as I had same issue before and I have solved it.
– Aasim Goriya
Sep 8 '18 at 6:10
Okay, I am trying.
– Vinod Kumar
Sep 8 '18 at 6:13
Okay, I am trying.
– Vinod Kumar
Sep 8 '18 at 6:13
ok please let me know if anything
– Aasim Goriya
Sep 8 '18 at 6:40
ok please let me know if anything
– Aasim Goriya
Sep 8 '18 at 6:40
add a comment |
1 Answer
1
active
oldest
votes
Please check following steps to resolve this issue.
Create your custom module to rewrite core files
In your /Vendor/Module/etc/di.xml add following code
<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="MagentoSalesModelOrderEmailSenderBuilder" type="VendorModuleRewriteSalesModelOrderEmailSenderBuilder" />
<preference for="MagentoFrameworkMailTemplateTransportBuilder" type="VendorModuleRewriteFrameworkMailTemplateTransportBuilder" />
</config>
In your /Vendor/Module/etc/module.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Vendor_Module" setup_version="1.0.0">
<sequence>
<module name="Magento_Sales"/>
</sequence>
</module>
</config>
In your Vendor/Module/Rewrite/Framework/Mail/Template/TransportBuilder.php
<?php
namespace VendorModuleRewriteFrameworkMailTemplate;
class TransportBuilder extends MagentoFrameworkMailTemplateTransportBuilder
{
/**
* @param $from
* @param $store
* @return $this
* @throws MagentoFrameworkExceptionMailException
*/
public function setFromByStore($from, $store)
{
$result = $this->_senderResolver->resolve($from, $store);
$this->message->setFrom($result['email'], $result['name']);
return $this;
}
}
In your Vendor/Module/Rewrite/Sales/Model/Order/Email/SenderBuilder.php
<?php
namespace VendorModuleRewriteSalesModelOrderEmail;
class SenderBuilder extends MagentoSalesModelOrderEmailSenderBuilder
{
/**
* Configure email template
*
* @return void
*/
protected function configureEmailTemplate()
{
$this->transportBuilder->setTemplateIdentifier($this->templateContainer->getTemplateId());
$this->transportBuilder->setTemplateOptions($this->templateContainer->getTemplateOptions());
$this->transportBuilder->setTemplateVars($this->templateContainer->getTemplateVars());
/*Send From Email Issue #Dev110*/
$this->transportBuilder->setFromByStore(
$this->identityContainer->getEmailIdentity(),
$this->identityContainer->getStore()->getId()
);
/*Send From Email Issue #Dev110*/
// $this->transportBuilderByStore->setFromByStore(
// $this->identityContainer->getEmailIdentity(),
// $this->identityContainer->getStore()->getId()
// );
}
}
1
Perfect...this is working fine for me. thank you
– Vinod Kumar
Sep 8 '18 at 7:11
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "479"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f241390%2fsales-emails-going-via-wrong-email-address-magento-2-2-x%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Please check following steps to resolve this issue.
Create your custom module to rewrite core files
In your /Vendor/Module/etc/di.xml add following code
<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="MagentoSalesModelOrderEmailSenderBuilder" type="VendorModuleRewriteSalesModelOrderEmailSenderBuilder" />
<preference for="MagentoFrameworkMailTemplateTransportBuilder" type="VendorModuleRewriteFrameworkMailTemplateTransportBuilder" />
</config>
In your /Vendor/Module/etc/module.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Vendor_Module" setup_version="1.0.0">
<sequence>
<module name="Magento_Sales"/>
</sequence>
</module>
</config>
In your Vendor/Module/Rewrite/Framework/Mail/Template/TransportBuilder.php
<?php
namespace VendorModuleRewriteFrameworkMailTemplate;
class TransportBuilder extends MagentoFrameworkMailTemplateTransportBuilder
{
/**
* @param $from
* @param $store
* @return $this
* @throws MagentoFrameworkExceptionMailException
*/
public function setFromByStore($from, $store)
{
$result = $this->_senderResolver->resolve($from, $store);
$this->message->setFrom($result['email'], $result['name']);
return $this;
}
}
In your Vendor/Module/Rewrite/Sales/Model/Order/Email/SenderBuilder.php
<?php
namespace VendorModuleRewriteSalesModelOrderEmail;
class SenderBuilder extends MagentoSalesModelOrderEmailSenderBuilder
{
/**
* Configure email template
*
* @return void
*/
protected function configureEmailTemplate()
{
$this->transportBuilder->setTemplateIdentifier($this->templateContainer->getTemplateId());
$this->transportBuilder->setTemplateOptions($this->templateContainer->getTemplateOptions());
$this->transportBuilder->setTemplateVars($this->templateContainer->getTemplateVars());
/*Send From Email Issue #Dev110*/
$this->transportBuilder->setFromByStore(
$this->identityContainer->getEmailIdentity(),
$this->identityContainer->getStore()->getId()
);
/*Send From Email Issue #Dev110*/
// $this->transportBuilderByStore->setFromByStore(
// $this->identityContainer->getEmailIdentity(),
// $this->identityContainer->getStore()->getId()
// );
}
}
1
Perfect...this is working fine for me. thank you
– Vinod Kumar
Sep 8 '18 at 7:11
add a comment |
Please check following steps to resolve this issue.
Create your custom module to rewrite core files
In your /Vendor/Module/etc/di.xml add following code
<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="MagentoSalesModelOrderEmailSenderBuilder" type="VendorModuleRewriteSalesModelOrderEmailSenderBuilder" />
<preference for="MagentoFrameworkMailTemplateTransportBuilder" type="VendorModuleRewriteFrameworkMailTemplateTransportBuilder" />
</config>
In your /Vendor/Module/etc/module.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Vendor_Module" setup_version="1.0.0">
<sequence>
<module name="Magento_Sales"/>
</sequence>
</module>
</config>
In your Vendor/Module/Rewrite/Framework/Mail/Template/TransportBuilder.php
<?php
namespace VendorModuleRewriteFrameworkMailTemplate;
class TransportBuilder extends MagentoFrameworkMailTemplateTransportBuilder
{
/**
* @param $from
* @param $store
* @return $this
* @throws MagentoFrameworkExceptionMailException
*/
public function setFromByStore($from, $store)
{
$result = $this->_senderResolver->resolve($from, $store);
$this->message->setFrom($result['email'], $result['name']);
return $this;
}
}
In your Vendor/Module/Rewrite/Sales/Model/Order/Email/SenderBuilder.php
<?php
namespace VendorModuleRewriteSalesModelOrderEmail;
class SenderBuilder extends MagentoSalesModelOrderEmailSenderBuilder
{
/**
* Configure email template
*
* @return void
*/
protected function configureEmailTemplate()
{
$this->transportBuilder->setTemplateIdentifier($this->templateContainer->getTemplateId());
$this->transportBuilder->setTemplateOptions($this->templateContainer->getTemplateOptions());
$this->transportBuilder->setTemplateVars($this->templateContainer->getTemplateVars());
/*Send From Email Issue #Dev110*/
$this->transportBuilder->setFromByStore(
$this->identityContainer->getEmailIdentity(),
$this->identityContainer->getStore()->getId()
);
/*Send From Email Issue #Dev110*/
// $this->transportBuilderByStore->setFromByStore(
// $this->identityContainer->getEmailIdentity(),
// $this->identityContainer->getStore()->getId()
// );
}
}
1
Perfect...this is working fine for me. thank you
– Vinod Kumar
Sep 8 '18 at 7:11
add a comment |
Please check following steps to resolve this issue.
Create your custom module to rewrite core files
In your /Vendor/Module/etc/di.xml add following code
<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="MagentoSalesModelOrderEmailSenderBuilder" type="VendorModuleRewriteSalesModelOrderEmailSenderBuilder" />
<preference for="MagentoFrameworkMailTemplateTransportBuilder" type="VendorModuleRewriteFrameworkMailTemplateTransportBuilder" />
</config>
In your /Vendor/Module/etc/module.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Vendor_Module" setup_version="1.0.0">
<sequence>
<module name="Magento_Sales"/>
</sequence>
</module>
</config>
In your Vendor/Module/Rewrite/Framework/Mail/Template/TransportBuilder.php
<?php
namespace VendorModuleRewriteFrameworkMailTemplate;
class TransportBuilder extends MagentoFrameworkMailTemplateTransportBuilder
{
/**
* @param $from
* @param $store
* @return $this
* @throws MagentoFrameworkExceptionMailException
*/
public function setFromByStore($from, $store)
{
$result = $this->_senderResolver->resolve($from, $store);
$this->message->setFrom($result['email'], $result['name']);
return $this;
}
}
In your Vendor/Module/Rewrite/Sales/Model/Order/Email/SenderBuilder.php
<?php
namespace VendorModuleRewriteSalesModelOrderEmail;
class SenderBuilder extends MagentoSalesModelOrderEmailSenderBuilder
{
/**
* Configure email template
*
* @return void
*/
protected function configureEmailTemplate()
{
$this->transportBuilder->setTemplateIdentifier($this->templateContainer->getTemplateId());
$this->transportBuilder->setTemplateOptions($this->templateContainer->getTemplateOptions());
$this->transportBuilder->setTemplateVars($this->templateContainer->getTemplateVars());
/*Send From Email Issue #Dev110*/
$this->transportBuilder->setFromByStore(
$this->identityContainer->getEmailIdentity(),
$this->identityContainer->getStore()->getId()
);
/*Send From Email Issue #Dev110*/
// $this->transportBuilderByStore->setFromByStore(
// $this->identityContainer->getEmailIdentity(),
// $this->identityContainer->getStore()->getId()
// );
}
}
Please check following steps to resolve this issue.
Create your custom module to rewrite core files
In your /Vendor/Module/etc/di.xml add following code
<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="MagentoSalesModelOrderEmailSenderBuilder" type="VendorModuleRewriteSalesModelOrderEmailSenderBuilder" />
<preference for="MagentoFrameworkMailTemplateTransportBuilder" type="VendorModuleRewriteFrameworkMailTemplateTransportBuilder" />
</config>
In your /Vendor/Module/etc/module.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Vendor_Module" setup_version="1.0.0">
<sequence>
<module name="Magento_Sales"/>
</sequence>
</module>
</config>
In your Vendor/Module/Rewrite/Framework/Mail/Template/TransportBuilder.php
<?php
namespace VendorModuleRewriteFrameworkMailTemplate;
class TransportBuilder extends MagentoFrameworkMailTemplateTransportBuilder
{
/**
* @param $from
* @param $store
* @return $this
* @throws MagentoFrameworkExceptionMailException
*/
public function setFromByStore($from, $store)
{
$result = $this->_senderResolver->resolve($from, $store);
$this->message->setFrom($result['email'], $result['name']);
return $this;
}
}
In your Vendor/Module/Rewrite/Sales/Model/Order/Email/SenderBuilder.php
<?php
namespace VendorModuleRewriteSalesModelOrderEmail;
class SenderBuilder extends MagentoSalesModelOrderEmailSenderBuilder
{
/**
* Configure email template
*
* @return void
*/
protected function configureEmailTemplate()
{
$this->transportBuilder->setTemplateIdentifier($this->templateContainer->getTemplateId());
$this->transportBuilder->setTemplateOptions($this->templateContainer->getTemplateOptions());
$this->transportBuilder->setTemplateVars($this->templateContainer->getTemplateVars());
/*Send From Email Issue #Dev110*/
$this->transportBuilder->setFromByStore(
$this->identityContainer->getEmailIdentity(),
$this->identityContainer->getStore()->getId()
);
/*Send From Email Issue #Dev110*/
// $this->transportBuilderByStore->setFromByStore(
// $this->identityContainer->getEmailIdentity(),
// $this->identityContainer->getStore()->getId()
// );
}
}
edited Sep 8 '18 at 6:09
answered Sep 8 '18 at 6:03
Aasim GoriyaAasim Goriya
2,6711734
2,6711734
1
Perfect...this is working fine for me. thank you
– Vinod Kumar
Sep 8 '18 at 7:11
add a comment |
1
Perfect...this is working fine for me. thank you
– Vinod Kumar
Sep 8 '18 at 7:11
1
1
Perfect...this is working fine for me. thank you
– Vinod Kumar
Sep 8 '18 at 7:11
Perfect...this is working fine for me. thank you
– Vinod Kumar
Sep 8 '18 at 7:11
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f241390%2fsales-emails-going-via-wrong-email-address-magento-2-2-x%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Please check my ans, as I had same issue before and I have solved it.
– Aasim Goriya
Sep 8 '18 at 6:10
Okay, I am trying.
– Vinod Kumar
Sep 8 '18 at 6:13
ok please let me know if anything
– Aasim Goriya
Sep 8 '18 at 6:40