Link to order from order confirmation email - magento-1.7

I`m trying to add link to order review in order confirmation email:
<a href="{{store url="sales/order/view/order_id/}}"{{var order.id}}" style="color:#1E7EC8;">
But when customer get the email it links just to http://mysite/sales/order/view/

Hi,
<a href="{{store url="sales/order/view/order_id/"}}{{var order.id}}" style="color:#1E7EC8;">
This is okay but it still not shows full link. It shows only sales/order/view/.
To show **order_id/**, you have to create Custom Variable.
Go to **System >> Custom Variables**.
Check Image below.
**http://imagizer.imageshack.com/img922/1470/tI8BGv.png**
Now create custom variable shown in image with any name.
Now revise the code and change the line.
<a href="{{store url="sales/order/view/"}}{{customVar code=static_url}}{{var order.id}}" style="color:#1E7EC8;">
It's working fine for me.
Thanks & Regards.

Move your quotes.
<a href="{{store url="sales/order/view/order_id/"}}{{var order.id}}" style="color:#1E7EC8;">

Related

Add product photo in transactional emails in magento 2

In the emails of the Magento 2 orders, all the details of the purchased product arrive, but I would also be interested in placing the image. Someone has implemented it so they can help me, I've tried to find the magento email templates to edit them, but it's all a mess.
I appreciate your help!
Someone has implemented it so they can help me, I've tried to find the magento email templates to edit them, but it's all a mess.
For this you have to override below file from "vendor" folder
vendor/magento/module-sales/view/frontend/templates/email/items/order/default.phtml
To your theme's design folder
app/design/frontend/[VENDOR]/[TEMPLATE]/Magento_Sales/templates/email/items/order/default.phtml
And then fetch product image using below code.
$_item = $block->getItem();
$_order = $_item->getOrder();
$_store = $_order->getStore();
$_imageHelper = \Magento\Framework\App\ObjectManager::getInstance()->get('Magento\Catalog\Helper\Image');
$_baseImageUrl = $_store->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_MEDIA).'catalog/product';
And add below Image tag inside first <td> above <p class="product-name">
<img src="<?= $_imageHelper->init($_item->getProduct(), 'small_image', ['type'=>'small_image'])->keepAspectRatio(true)->resize('65','65')->getUrl();?>" alt="<?= __('Product Image');?>">
you can add Image as separate column as well. But for that you have to override below file as well.
vendor/magento/module-sales/view/frontend/templates/email/items.phtml
And need to add extra <th> In <table class="email-items">
Please try this solution and let me know if you face any issue.

PowerApps Modify Email-Screen Template

Hi I have a PowerApp connected to Sharepoint List. The sharepoint list has 2 to columns that are lookup values of peson/group. Please see screenshot of powerapp display screen below.
As I noted on the screenshot, I want have a button to send email. When the button is clicked, the email-screen template by PowerApps (Link) appears.
How do I autopopulate the Sponsor and BackUp Sponsor fields to the Email-Template, while still allowing the user to add more people if necessary?
I am not sure if this is needed but 
I don't think you will be able to add the people into that control, but you could create a label that shows the people from your form above the "To" field in the email form and let the user enter additional recipients into the To field.
The icon that triggers the sending of the mail has underlying code in the OnSelect property. The first command in there sets the variable _emailRecipientString by concatenating several strings.
Set( _emailRecipientString, Concat(MyPeople, Mail & ";") );
Add your list of people as parameters inside the Concat() function.
I also posted the answer here
here is the answer:
Add the code to the Notify/Send Email in the Display Screen
ClearCollect(selecteduser,
ForAll(DataCardValue1.SelectedItems,Office365Users.SearchUser({searchTerm:Email})),
ForAll(DataCardValue2.SelectedItems,Office365Users.SearchUser({searchTerm:Email}))
);
Clear(MyPeople); ForAll(selecteduser,Collect(MyPeople,Value))
I hope this helps someone else

Can I use HTML to create a vote button on an email that sends a reply?

Situation:
I am a HTML newbie who gets by through Google-fu and I am in charge of a tool which sends HTML email to customers.
I have been asked by our customers (Because pressing reply and typing a single word is really difficult) if I can create buttons on the emails I send which allows them a 1-click reply.
Conditions:
The reply has to come from their own email address
It needs to go back to the email address that sent the email (We have one template email which can be sent from several addresses)
It needs to maintain the same subject line (It contains a reference number to ensure the email is processed correctly when received)
Must be created using inline HTML(4 or 5) only (Restrictions of the system that generates the email)
Ideally will send the reply immediately (And show them as much in some manner), but opening up a new email already pre-populated is an acceptable alternative
I have struggled to find much at all on this, which leads me to think that it is not possible.
If using tiny bit of pure javascript, that does not need any external library on your website.
This code goes to your website where you want your check to be made.
<script>
function getURLParameter(name) {
return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search) || [null, ''])[1].replace(/\+/g, '%20')) || null;
}
document.addEventListener("DOMContentLoaded", function(event) {
if(getURLParameter('answ') == 0) document.getElementById('answered_yes').remove();
else if(getURLParameter('answ') == 1) document.getElementById('answered_no').remove();
else {
document.getElementById('answered_yes').remove(); document.getElementById('answered_no').remove();
}
});
</script>
<div id="answered_yes">
THIS IS HOLDER FOR YES ANSWERER //Put your wanted info hare if he answered yes
</div>
<div id="answered_no">
THIS IS HOLDER FOR NO ANSWERER //Put your wanted info hare if he answered no
</div>
Now on email links put these type of links.
<a href="yourwebsite.com/index.php?answ=0" target="_blank" >ANSWER NO</a>
<a href="yourwebsite.com/index.php?answ=1" target="_blank" >ANSWER YES</a>
What this does is simply puts a parameter on a link called answ that has 0 or 1 by my setting and once your website gets a request it checks which parameter is it 0 or 1. If its 0 that means we remove the div that says yes, otherwise do the same with no div.
with only html it is not possible unless you would give him different links as in.
<a href="yoursite.com/he_answered_no.html" >No</a>
<a href="yoursite.com/he_answered_yes.html" >Yes</a>
And put your contents inside there.
However if you are going to use this script in your website, put that code somewhere in the body, its not perfect, but it will do the job. Then put your information on yes div and on no div, its going to remove whatever div he answers too.
But like I mentioned, with purely HTML it is not possible only adding some bits with other languages, pure javascript should work on any HTML site, unless you are trying to add the code to some kind of platform that blocks any ongoing scripts.
You can just use a "mailto:" link similar to this:
Email Us
Here's the link with more info: https://css-tricks.com/snippets/html/mailto-links/
It will open up a prepopulated email with the "to" address, subject line, and body text already inserted. People will be able to modify the text if they want or just click send. You would need to some way to dynamically change the subject line to the one the customer received, but your email tool probably has that capability.

IE form action URL issue

Recently i am started tuning our products to IE compatability. Now i am facing a weird problem in IE alone.
My form url is something like this https://x.com/formurl/dynamicvalue
and my form element is
<form action="" method='post'>
...
</form>
some values the dynamicvalue holds are ( Alphanumeric characters )
plan
plan2
1234443
544
Except IE every other browsers sending the actions to https://x.com/formurl/dynamicvalue
IE form action is sending to https://x.com/formurl
I don't know why this is happening, I can replace the document.URL to post the Form back to solve the problem. Still, i want to what's the reason for IE to remove that dynamicvalue
I am testing in IE-9
Kindly someone teach me.
Thanks in advance.
I have also discovered this bug in Internet Explorer 11 when reading the action attribute of a form with action set to the empty string.
<form action="" method="post"></form>
If one reads the form.action attribute in javascript and the current URL does not contain a trailing slash, the last part of the URL will be removed. I.e., if the location is example.com/xxx/yyy, form.action=="example.com/xxx, while if location is example.com/xxx/yyy/, form.action=="example.com/xxx/yyy/.
However, if the form is posted by clicking a submit button, it is posted to the correct URL, i.e., example.com/xxx/yyy or example.com/xxx/yyy/.
I overcame this by using jQuery's attr function to check if action="" in the HTML and then I use location.href instead.
if($(form).attr('action') === '') return location.href else return $(form).attr('action')
(Why would someone do this? I am intercepting the form submit and using ajax to send the data. To do this, I need to know where the form wants to submit)

We want to have a customized subscription form, that includes a coupon code input

As I understand it - I cannot use Recurly.js v3 for this... the hosted pages are not very pretty - so we want to style our own, however it seems like the coupon code field is not supported - and its very necessary for our business model.
Am I missing something?
It's definitely supported. Just add an input and use the data-recurly="coupon" attribute:
<input type="text" data-recurly="coupon">
You can see it in the pricing section of the R.JS docs.
I have integrated this into my application in few weeks ago. You can add the following to your page for the coupon code field.
<input type="text" name="couponcode" placeholder="Coupon Code" data-recurly="coupon_code" >
You can get the value by input field name name="couponcode". Following is the PHP code.
'coupon-code' => sanitize_text_field($_POST['couponcode'])