Inside the template account_new_confirmation, which is the template of the confirmation mail the user receives after he creates a new account, I need to add a param inside the tag
在模板account_new_confirmation中,这是用户在创建新帐户后收到的确认邮件的模板,我需要在标签内添加一个参数
{{store url="customer/account/confirm/" _query_id=$customer.id _query_key=$customer.confirmation _query_back_url=$back_url _query_myparam="TEST"}}
this is working for a string producing the following link to be written inside the confirmation mail as expected:
这适用于生成以下链接的字符串,以便按预期在确认邮件中写入:
http://baseurl/customer/account/confirm/?id=12345&key=donkey&back_url=monkey&myparam=TEST
but I cannot figure out how to replace the string TEST with the value of a param I have in request post.
I mean the user reach this point after having filled a form sent with POST action. Inside this form I have a checkbox named FOO and I need to add its value (true or false) to _query_myparam on my example above.
I tried with
但我无法弄清楚如何用我在请求帖子中的param的值替换字符串TEST。我的意思是用户填写了一个用POST动作发送的表单后达到了这一点。在这个表单中,我有一个名为FOO的复选框,我需要在上面的示例中将其值(true或false)添加到_query_myparam。我试过了
_query_param=$foo
and with
_query_param=$this->getRequest()->getPost('foo')
but they both were too easy to work.
Anyone knows how to solve this?
但他们都太容易上班了。谁知道怎么解决这个问题?
1 个解决方案
#1
0
I found it myself :D
我自己找到了:D
You have to change the method sendNewAccountEmail
of the class Mage_Customer_Model_Customer
which you can find in app/code/core/Mage/Customer/Model/Customer.php
您必须更改类Mage_Customer_Model_Customer的方法sendNewAccountEmail,您可以在app / code / core / Mage / Customer / Model / Customer.php中找到它。
You need to add new variables available inside the template inside:
您需要在模板内添加可用的新变量:
array('customer' => $this, 'back_url' => $backUrl)
So for your need this would be changed in:
因此,根据您的需要,这将改变:
array('customer' => $this, 'back_url' => $backUrl, 'foo' => Mage::app()->getRequest()->getPost('foo'))
Then you can add this variable to the template param as
然后,您可以将此变量添加到模板参数中
{{store url="customer/account/confirm/" _query_id=$customer.id _query_key=$customer.confirmation _query_back_url=$back_url _query_myparam=$foo}}
This will produce the following link:
这将产生以下链接:
http://baseurl/customer/account/confirm/?id=12345&key=donkey&back_url=monkey&myparam=on
when checkbox FOO is checked.
选中复选框FOO时。
Thanks
#1
0
I found it myself :D
我自己找到了:D
You have to change the method sendNewAccountEmail
of the class Mage_Customer_Model_Customer
which you can find in app/code/core/Mage/Customer/Model/Customer.php
您必须更改类Mage_Customer_Model_Customer的方法sendNewAccountEmail,您可以在app / code / core / Mage / Customer / Model / Customer.php中找到它。
You need to add new variables available inside the template inside:
您需要在模板内添加可用的新变量:
array('customer' => $this, 'back_url' => $backUrl)
So for your need this would be changed in:
因此,根据您的需要,这将改变:
array('customer' => $this, 'back_url' => $backUrl, 'foo' => Mage::app()->getRequest()->getPost('foo'))
Then you can add this variable to the template param as
然后,您可以将此变量添加到模板参数中
{{store url="customer/account/confirm/" _query_id=$customer.id _query_key=$customer.confirmation _query_back_url=$back_url _query_myparam=$foo}}
This will produce the following link:
这将产生以下链接:
http://baseurl/customer/account/confirm/?id=12345&key=donkey&back_url=monkey&myparam=on
when checkbox FOO is checked.
选中复选框FOO时。
Thanks