How to show image in custom email. Magento 2product image url not valid - magento 2.0.1Magento 2 : How to show ProductName and ProductPrice in custom email template?In magento how to format date in email template?display product's custom image in custom emailMagento 2 Add new field to Magento_User admin formHow to add custom attribute in new order confirmation email in Magento 1.9.3?In Magento 2 How to use CSS Grid in CMS pagesMagento 2: Image in custom email module?Magento 2.2: How to show a cutomer custom attribute on frontend?How to send Product Image in Mail. Magento 2

How did Captain America use this power?

Problems with numbers (result of calculations) alignment using siunitx package inside tabular environment

I’ve officially counted to infinity!

Topological Spaces homeomorphic

Disabling Resource Governor in SQL Server

The barbers paradox first order logic formalization

If Earth is tilted, why is Polaris always above the same spot?

What is the most remote airport from the center of the city it supposedly serves?

If Melisandre foresaw another character closing blue eyes, why did she follow Stannis?

Visa for volunteering in England

Can commander tax be proliferated?

How to reply this mail from potential PhD professor?

How do you center multiple equations that have multiple steps?

Would "lab meat" be able to feed a much larger global population

How to assert on pagereference where the endpoint of pagereference is predefined

Why debootstrap can only run as root?

Why do money exchangers give different rates to different bills

Why do computer-science majors learn calculus?

How do I tell my manager that his code review comment is wrong?

What happened to Ghost?

How to get SEEK accessing converted ID via view

Pigeonhole Principle Problem

Selecting a secure PIN for building access

Is Cola "probably the best-known" Latin word in the world? If not, which might it be?



How to show image in custom email. Magento 2


product image url not valid - magento 2.0.1Magento 2 : How to show ProductName and ProductPrice in custom email template?In magento how to format date in email template?display product's custom image in custom emailMagento 2 Add new field to Magento_User admin formHow to add custom attribute in new order confirmation email in Magento 1.9.3?In Magento 2 How to use CSS Grid in CMS pagesMagento 2: Image in custom email module?Magento 2.2: How to show a cutomer custom attribute on frontend?How to send Product Image in Mail. Magento 2






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








2















I'm getting my custom data from email function and also I'm getting the Product image URL to show it in mail now I tried many ways to show my image in email but its not working for me my custom email code is



 template config_path="design/email/header_template" 
<p align="center"><b style="color: #009900">Name:</b> trans "%name" name=$name</p>
<p align="center"><b style="color: #009900">Email:</b> trans "%email" email=$email</p>
<p align="center"><b style="color: #009900">Phone Number:</b> trans "%pnumber" pnumber=$pnumber</p>
<p align="center"><b style="color: #009900">Offer Amount:</b> trans "%offeramount" offeramount=$offeramount</p>
<p align="center"><b style="color: #009900">Message:</b> trans "%message" message=$message</p>
<p align="center"><b style="color: #009900">Product Name:</b> trans "%product_name" product_name=$product_name</p>
<p align="center"><b style="color: #009900">Product Price:</b> trans "%product_price" product_price=$product_price</p>
<p align="center"><b style="color: #009900">URL:</b> trans '%imgUrl' imgUrl=$imgUrl</p>
<!-- <img src="">trans '%imgUrl' imgUrl=$imgUrl</img> -->
<!-- <img src="trans '%imgUrl' imgUrl=$imgUrl"> -->
<img src="view url='%imgUrl'" height="30" width="30" alt="trans 'Custom image'" />
template config_path="design/email/footer_template"


I get the code from net which is



 <img
width="180"
height="52"
src="view url='images/email/youtube.jpg'"
alt="Website Youtube"
/>


but now my question is how can I set Dynamic URL in place of fixed URL e.g in place of this URL images/email/youtube.jpg I want to set my URL










share|improve this question
























  • From wherever your email is been triggered after any action in controller you might be passing some variables just pass your email url also in email vars and consume them. For reference you can open any default Magento email templates.

    – Narendra Vyas
    Mar 20 at 16:01











  • Sir I also pass the url as well if you can see this code trans '%imgUrl' imgUrl=$imgUrl in above code that is URL which I firstly just print in <p> to check that URL is coming properly or not after that I tried this for <img> tag but at that place it is not working

    – Asad Khan
    Mar 20 at 16:06












  • Try src = " imgUrl"

    – Narendra Vyas
    Mar 20 at 16:11











  • Are you.trying from your local ? Make sure you don't have any issue in showing images in every email ?

    – Narendra Vyas
    Mar 20 at 16:13











  • Sir Actually firstly when I get the URL of the product then firstly I check it in phtml file for testing that is it getting the img of the product or not.. then its shows me the img perfectly after that I send the URL in the mail

    – Asad Khan
    Mar 20 at 16:15

















2















I'm getting my custom data from email function and also I'm getting the Product image URL to show it in mail now I tried many ways to show my image in email but its not working for me my custom email code is



 template config_path="design/email/header_template" 
<p align="center"><b style="color: #009900">Name:</b> trans "%name" name=$name</p>
<p align="center"><b style="color: #009900">Email:</b> trans "%email" email=$email</p>
<p align="center"><b style="color: #009900">Phone Number:</b> trans "%pnumber" pnumber=$pnumber</p>
<p align="center"><b style="color: #009900">Offer Amount:</b> trans "%offeramount" offeramount=$offeramount</p>
<p align="center"><b style="color: #009900">Message:</b> trans "%message" message=$message</p>
<p align="center"><b style="color: #009900">Product Name:</b> trans "%product_name" product_name=$product_name</p>
<p align="center"><b style="color: #009900">Product Price:</b> trans "%product_price" product_price=$product_price</p>
<p align="center"><b style="color: #009900">URL:</b> trans '%imgUrl' imgUrl=$imgUrl</p>
<!-- <img src="">trans '%imgUrl' imgUrl=$imgUrl</img> -->
<!-- <img src="trans '%imgUrl' imgUrl=$imgUrl"> -->
<img src="view url='%imgUrl'" height="30" width="30" alt="trans 'Custom image'" />
template config_path="design/email/footer_template"


I get the code from net which is



 <img
width="180"
height="52"
src="view url='images/email/youtube.jpg'"
alt="Website Youtube"
/>


but now my question is how can I set Dynamic URL in place of fixed URL e.g in place of this URL images/email/youtube.jpg I want to set my URL










share|improve this question
























  • From wherever your email is been triggered after any action in controller you might be passing some variables just pass your email url also in email vars and consume them. For reference you can open any default Magento email templates.

    – Narendra Vyas
    Mar 20 at 16:01











  • Sir I also pass the url as well if you can see this code trans '%imgUrl' imgUrl=$imgUrl in above code that is URL which I firstly just print in <p> to check that URL is coming properly or not after that I tried this for <img> tag but at that place it is not working

    – Asad Khan
    Mar 20 at 16:06












  • Try src = " imgUrl"

    – Narendra Vyas
    Mar 20 at 16:11











  • Are you.trying from your local ? Make sure you don't have any issue in showing images in every email ?

    – Narendra Vyas
    Mar 20 at 16:13











  • Sir Actually firstly when I get the URL of the product then firstly I check it in phtml file for testing that is it getting the img of the product or not.. then its shows me the img perfectly after that I send the URL in the mail

    – Asad Khan
    Mar 20 at 16:15













2












2








2








I'm getting my custom data from email function and also I'm getting the Product image URL to show it in mail now I tried many ways to show my image in email but its not working for me my custom email code is



 template config_path="design/email/header_template" 
<p align="center"><b style="color: #009900">Name:</b> trans "%name" name=$name</p>
<p align="center"><b style="color: #009900">Email:</b> trans "%email" email=$email</p>
<p align="center"><b style="color: #009900">Phone Number:</b> trans "%pnumber" pnumber=$pnumber</p>
<p align="center"><b style="color: #009900">Offer Amount:</b> trans "%offeramount" offeramount=$offeramount</p>
<p align="center"><b style="color: #009900">Message:</b> trans "%message" message=$message</p>
<p align="center"><b style="color: #009900">Product Name:</b> trans "%product_name" product_name=$product_name</p>
<p align="center"><b style="color: #009900">Product Price:</b> trans "%product_price" product_price=$product_price</p>
<p align="center"><b style="color: #009900">URL:</b> trans '%imgUrl' imgUrl=$imgUrl</p>
<!-- <img src="">trans '%imgUrl' imgUrl=$imgUrl</img> -->
<!-- <img src="trans '%imgUrl' imgUrl=$imgUrl"> -->
<img src="view url='%imgUrl'" height="30" width="30" alt="trans 'Custom image'" />
template config_path="design/email/footer_template"


I get the code from net which is



 <img
width="180"
height="52"
src="view url='images/email/youtube.jpg'"
alt="Website Youtube"
/>


but now my question is how can I set Dynamic URL in place of fixed URL e.g in place of this URL images/email/youtube.jpg I want to set my URL










share|improve this question
















I'm getting my custom data from email function and also I'm getting the Product image URL to show it in mail now I tried many ways to show my image in email but its not working for me my custom email code is



 template config_path="design/email/header_template" 
<p align="center"><b style="color: #009900">Name:</b> trans "%name" name=$name</p>
<p align="center"><b style="color: #009900">Email:</b> trans "%email" email=$email</p>
<p align="center"><b style="color: #009900">Phone Number:</b> trans "%pnumber" pnumber=$pnumber</p>
<p align="center"><b style="color: #009900">Offer Amount:</b> trans "%offeramount" offeramount=$offeramount</p>
<p align="center"><b style="color: #009900">Message:</b> trans "%message" message=$message</p>
<p align="center"><b style="color: #009900">Product Name:</b> trans "%product_name" product_name=$product_name</p>
<p align="center"><b style="color: #009900">Product Price:</b> trans "%product_price" product_price=$product_price</p>
<p align="center"><b style="color: #009900">URL:</b> trans '%imgUrl' imgUrl=$imgUrl</p>
<!-- <img src="">trans '%imgUrl' imgUrl=$imgUrl</img> -->
<!-- <img src="trans '%imgUrl' imgUrl=$imgUrl"> -->
<img src="view url='%imgUrl'" height="30" width="30" alt="trans 'Custom image'" />
template config_path="design/email/footer_template"


I get the code from net which is



 <img
width="180"
height="52"
src="view url='images/email/youtube.jpg'"
alt="Website Youtube"
/>


but now my question is how can I set Dynamic URL in place of fixed URL e.g in place of this URL images/email/youtube.jpg I want to set my URL







magento2 email frontend backend






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 21 at 8:55







Asad Khan

















asked Mar 20 at 15:36









Asad KhanAsad Khan

39510




39510












  • From wherever your email is been triggered after any action in controller you might be passing some variables just pass your email url also in email vars and consume them. For reference you can open any default Magento email templates.

    – Narendra Vyas
    Mar 20 at 16:01











  • Sir I also pass the url as well if you can see this code trans '%imgUrl' imgUrl=$imgUrl in above code that is URL which I firstly just print in <p> to check that URL is coming properly or not after that I tried this for <img> tag but at that place it is not working

    – Asad Khan
    Mar 20 at 16:06












  • Try src = " imgUrl"

    – Narendra Vyas
    Mar 20 at 16:11











  • Are you.trying from your local ? Make sure you don't have any issue in showing images in every email ?

    – Narendra Vyas
    Mar 20 at 16:13











  • Sir Actually firstly when I get the URL of the product then firstly I check it in phtml file for testing that is it getting the img of the product or not.. then its shows me the img perfectly after that I send the URL in the mail

    – Asad Khan
    Mar 20 at 16:15

















  • From wherever your email is been triggered after any action in controller you might be passing some variables just pass your email url also in email vars and consume them. For reference you can open any default Magento email templates.

    – Narendra Vyas
    Mar 20 at 16:01











  • Sir I also pass the url as well if you can see this code trans '%imgUrl' imgUrl=$imgUrl in above code that is URL which I firstly just print in <p> to check that URL is coming properly or not after that I tried this for <img> tag but at that place it is not working

    – Asad Khan
    Mar 20 at 16:06












  • Try src = " imgUrl"

    – Narendra Vyas
    Mar 20 at 16:11











  • Are you.trying from your local ? Make sure you don't have any issue in showing images in every email ?

    – Narendra Vyas
    Mar 20 at 16:13











  • Sir Actually firstly when I get the URL of the product then firstly I check it in phtml file for testing that is it getting the img of the product or not.. then its shows me the img perfectly after that I send the URL in the mail

    – Asad Khan
    Mar 20 at 16:15
















From wherever your email is been triggered after any action in controller you might be passing some variables just pass your email url also in email vars and consume them. For reference you can open any default Magento email templates.

– Narendra Vyas
Mar 20 at 16:01





From wherever your email is been triggered after any action in controller you might be passing some variables just pass your email url also in email vars and consume them. For reference you can open any default Magento email templates.

– Narendra Vyas
Mar 20 at 16:01













Sir I also pass the url as well if you can see this code trans '%imgUrl' imgUrl=$imgUrl in above code that is URL which I firstly just print in <p> to check that URL is coming properly or not after that I tried this for <img> tag but at that place it is not working

– Asad Khan
Mar 20 at 16:06






Sir I also pass the url as well if you can see this code trans '%imgUrl' imgUrl=$imgUrl in above code that is URL which I firstly just print in <p> to check that URL is coming properly or not after that I tried this for <img> tag but at that place it is not working

– Asad Khan
Mar 20 at 16:06














Try src = " imgUrl"

– Narendra Vyas
Mar 20 at 16:11





Try src = " imgUrl"

– Narendra Vyas
Mar 20 at 16:11













Are you.trying from your local ? Make sure you don't have any issue in showing images in every email ?

– Narendra Vyas
Mar 20 at 16:13





Are you.trying from your local ? Make sure you don't have any issue in showing images in every email ?

– Narendra Vyas
Mar 20 at 16:13













Sir Actually firstly when I get the URL of the product then firstly I check it in phtml file for testing that is it getting the img of the product or not.. then its shows me the img perfectly after that I send the URL in the mail

– Asad Khan
Mar 20 at 16:15





Sir Actually firstly when I get the URL of the product then firstly I check it in phtml file for testing that is it getting the img of the product or not.. then its shows me the img perfectly after that I send the URL in the mail

– Asad Khan
Mar 20 at 16:15










0






active

oldest

votes












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
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f266730%2fhow-to-show-image-in-custom-email-magento-2%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































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.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f266730%2fhow-to-show-image-in-custom-email-magento-2%23new-answer', 'question_page');

);

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







Popular posts from this blog

Identifying “long and narrow” polygons in with PostGISlength and width of polygonWhy postgis st_overlaps reports Qgis' “avoid intersections” generated polygon as overlapping with others?Adjusting polygons to boundary and filling holesDrawing polygons with fixed area?How to remove spikes in Polygons with PostGISDeleting sliver polygons after difference operation in QGIS?Snapping boundaries in PostGISSplit polygon into parts adding attributes based on underlying polygon in QGISSplitting overlap between polygons and assign to nearest polygon using PostGIS?Expanding polygons and clipping at midpoint?Removing Intersection of Buffers in Same Layers

Masuk log Menu navigasi

อาณาจักร (ชีววิทยา) ดูเพิ่ม อ้างอิง รายการเลือกการนำทาง10.1086/39456810.5962/bhl.title.447410.1126/science.163.3863.150576276010.1007/BF01796092408502"Phylogenetic structure of the prokaryotic domain: the primary kingdoms"10.1073/pnas.74.11.5088432104270744"Towards a natural system of organisms: proposal for the domains Archaea, Bacteria, and Eucarya"1990PNAS...87.4576W10.1073/pnas.87.12.4576541592112744PubMedJump the queueexpand by handPubMedJump the queueexpand by handPubMedJump the queueexpand by hand"A revised six-kingdom system of life"10.1111/j.1469-185X.1998.tb00030.x9809012"Only six kingdoms of life"10.1098/rspb.2004.2705169172415306349"Kingdoms Protozoa and Chromista and the eozoan root of the eukaryotic tree"10.1098/rsbl.2009.0948288006020031978เพิ่มข้อมูล