TYPO3 Formhandler Finisher_Mail multiple receivers with to_email + addTolist - typo3

I have a formhandler-form and I'm trying to find a good way to send an admin mail to multiple recipients with one mail finisher. The Problem is the recipients are variable. The recipients of the mail depends on the selection of 10 checkboxes in the form. Each selection should have the effect that a new recipient is added. At the moment it's solved with 10 mail finisher like
if {
1 {
conditions {
OR1.AND1 = checkbox_1 = 1
}
isTrue {
finishers.1.config.admin.to_email = p1#mail.com
}
else {
finishers.1.config.admin.disable = 1
}
}
2 {
conditions {
OR1.AND1 = checkbox_2 = 1
}
isTrue {
finishers.2.config.admin.to_email = p2#mail.com
}
else {
finishers.2.config.admin.disable = 1
}
}
...
Is there a better way? I tried to solve this with one finisher and the usage of addToList
if {
1 {
conditions {
OR1.AND1 = checkbox_1 = 1
}
isTrue {
finishers.1.config.admin.to_email := addToList(p1#mail.com)
}
}
2 {
conditions {
OR1.AND1 = checkbox_2 = 1
}
isTrue {
finishers.1.config.admin.to_email := addToList(p2#mail.com)
}
}
...
But it doesn't work. With 4 selected boxes it is still one recipient. Why?

don't forget: typoscript is a configuration language, no programming language.
so you need another logic to build up the multiple receivers.
something like:
:
finishers.1.config.admin.to_email = COA
finishers.1.config.admin.to_email {
10 = TEXT
10.value = p1#mail.com,
10.if.isTrue.data = checkBox_1
20 = TEXT
20.value = p2#mail.com,
20.if.isTrue.data = checkBox_2
30 = TEXT
30.value = p3#mail.com,
30.if.isTrue.data = checkBox_3
stdWrap.substring = 0,-1
}

Related

How do I override HMENU Special setting based on layout?

I have a menu element that is set to list the selected pages.
tt_content.my_menu {
dataProcessing {
10 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
10 {
special = list
special.value.field = pages
}
}
}
How can I change this to a directory of pages when a specific layout is set?
tt_content.my_menu {
dataProcessing {
10 {
special {
override = directory
override.if.value = my-layout
override.if.equals.field = layout
}
}
}
}
I'm not sure if MenuProcessor? has stdWrap on its properties.
But it should be possible to define two processors, each with an if:
tt_content.my_menu {
dataProcessing {
10 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
10 {
if {
value = my-layout
equals.field = layout
negate = 1
}
special = list
special.value.field = pages
}
20 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
20 {
if {
value = my-layout
equals.field = layout
}
special = directory
special.value.field = pages
}
}
}

Set levels property for menu_subpages depdending on layout

I have the following typoscript configuration for the menu_subpages object:
tt_content.menu_subpages {
dataProcessing {
10 {
levels = 1
as = menu
expandAll = 1
includeSpacer = 1
}
}
}
To give the editor more flexibility I want to set the levels property depending on the selected layout of the content object. I've tried to use the CASE object but this doesn't seem to work:
tt_content.menu_subpages {
dataProcessing {
10 {
levels = CASE
levels {
key.field = layout
default = TEXT
default.value = 1
1000 = TEXT
1000.value = 7
}
...
}
}
}
Thanks for any help!
As levels is no object but a property you can't use it as an object.
Either you change it to an object:
tt_content.menu_subpages {
dataProcessing {
10 {
levels.cObject = CASE
levels.cObject {
:
}
...
}
}
}
Or you need to set the value inside a typoscript condition.
tt_content.menu_subpages {
dataProcessing {
10 {
// default:
levels = 1
...
}
}
}
[page['layout'] == 1000]
tt_content.menu_subpages.dataProcessing.10.levels = 7
[page['layout'] = 2000]
tt_content.menu_subpages.dataProcessing.10.levels = 3
[global]

Why user comment is not in email order confirmation html opencart 2?

I noticed that in opencart 2.3.0.2 the order confirmation for admin contains the comments from the user, and the email that the user gets doesn't.
The user gets only the text version with the comment, not the HTML version with the comment.
In 2012 2013 the problem was that the comment wasn't passed at all into the emails.
https://github.com/opencart/opencart/pull/94
https://github.com/opencart-ce/opencart-ce/issues/12
It seems the problem was solved only partially.
The solution is:
Edit:
catalog/model/checkout/order.php
Put this code:
$data['ip'] = $order_info['ip'];
$data['order_status'] = $order_status;
if ($comment && $notify) {
$data['comment'] = nl2br($comment);
} else {
$data['comment'] = '';
}
if ($comment) {
if ($order_info['comment']) {
$data['comment'] = nl2br($comment) . '<br/><br/><strong>Comment:</strong><br/>' . $order_info['comment'];
} else {
$data['comment'] = nl2br($comment);
}
} else {
if ($order_info['comment']) {
$data['comment'] = $order_info['comment'];
} else {
$data['comment'] = '';
}
}
instead of:
$data['ip'] = $order_info['ip'];
$data['order_status'] = $order_status;
if ($comment && $notify) {
$data['comment'] = nl2br($comment);
} else {
$data['comment'] = '';
}
Or you can install this mod https://www.opencart.com/index.php?route=marketplace/extension/info&extension_id=32499&filter_search=add%20comment&filter_category_id=8&filter_license=0

formhandler typo3 feuser double opt in

I have a user registration form with the extension formhandler and a user is created in the right sysfolder. But the double opt in link which is created and send via e-mail does not work. The user is still hidden. I think that the link does not include the sysfolder with the feuserdata. When I click the link I get the error message: that the authorization code is not found and maybe the authorization has already been done. But that is not true.
plugin.Tx_Formhandler.settings.predef.register {
name = Formhandler User Registration
templateFile = typo3conf/templates/main/plugins/formhandler/register.html
disableWrapInBaseClass = 1
formID = registration
formValuesPrefix = feregistration
isErrorMarker.default = error
isErrorMarker {
global = error
}
preProcessors {
1.class = PreProcessor_LoadGetPost
2.class = PreProcessor_ValidateAuthCode
2.config {
redirectPage = 1045
hiddenField = hidden
selectFields = email
additionalParams = COA
additionalParams {
10 = TEXT
10.value = &pid=1044
}
}
}
finishers {
1.class = Finisher_DB
1.config {
table = fe_users
fields {
pid.postProcessing = 1044
email.mapping = email
username.mapping = email
password.mapping = password
password.special = saltedpassword
password.special.field = password
first_name.mapping = firstname
last_name.mapping = name
address.mapping = streetno
usergroup.ifIsEmpty = 1
disable.ifIsEmpty = 1
}
}
2.class = Finisher_GenerateAuthCode
2.config {
table = fe_users
fields {
pid.postProcessing = 1044
}
selectFields = email
}
3.class = Finisher_DB
3.config {
table = fe_users
updateInsteadOfInsert = 1
fields {
fe_cruser_id.special = inserted_uid
fe_cruser_id.special.table = fe_users
}
}
4.class = Finisher_Mail
4.config {
checkBinaryCrLf = message
admin {
to_email = admin#mail.de
subject = TEXT
subject.dataWrap = Neue Registrierung: {GP:formhandler|firstname} {GP:formhandler|name}
sender_email = email
replyto_email = email
}
user {
to_email = email
to_name = name
subject = Vielen Dank für deine Registrierung
sender_email = user#mail.de
sender_name = user
replyto_email = user#mail.de
replyto_name = user
}
}
5.class = Finisher_SubmittedOK
5.config {
returns = 1
}
}
}
I tried to include the sysfolder pid as an additional parameter but the url does not get this parameter.
In your preProcessor, hiddenField should be disable. This is the name of the field you want to set to 0 if the auth code is validated. You should also ensure there actually is an hidden field in your form named disable and with value 1.

SuperBoxSelect: Using Shift+Click to Select Multiple Items at Once

When implementing SuperBoxSelect (http://www.sencha.com/forum/showthread.php?69307-3.x-Ext.ux.form.SuperBoxSelect), I've realized that it currently does not support shift + click selection of multiple items. Has anyone been able to implement this functionality or found a similar plugin that offers this functionality?
beforeadditem:function(self, recordValue) {
var start = 0;
var end = 0;
var record = this.findRecord(this.valueField, recordValue);
var recordIndex = this.store.indexOf(record);
if(window.event.shiftKey) {
this.multiSelectMode = true;
if(this.firstChoiceIndex == undefined) {
this.firstChoiceIndex = recordIndex;
this.view.all.item(recordIndex).addClass('x-combo-selected-shift');
return false;
} else {
this.secondChoiceIndex = recordIndex;
if(this.firstChoiceIndex > this.secondChoiceIndex) {
start = this.secondChoiceIndex;
end = this.firstChoiceIndex;
} else if(this.secondChoiceIndex > this.firstChoiceIndex) {
start = this.firstChoiceIndex;
end = this.secondChoiceIndex;
}
var selectedRecords = this.store.getRange(start, end);
Ext.each(selectedRecords, function(item, index, allitems) {
self.addRecord(item)
});
this.firstChoiceIndex = undefined;
this.secondChoiceIndex = undefined;
return false;
}
} else {
this.firstChoiceIndex = undefined;
this.secondChoiceIndex = undefined;
return true;
}
}
Add that listener and it works. The x-combo-selected-shift class is identical to the x-combo-selected class. It's just named different so the highlighting sticks to the item you shift+clicked on after you mouse out.