Undeclared arguments passed to ViewHelper Undkonsorten\Powermailpdf\ViewHelpers\Misc\VariablesViewHelper: mail - typo3

In TYPO3 9.5 using powermail with powermailpdf I'm getting the following error when submitting a form...
Undeclared arguments passed to ViewHelper Undkonsorten\Powermailpdf\ViewHelpers\Misc\VariablesViewHelper: mail.
It appears that it's complaining about mail but I don't know what to do about it. I've included the static templates for powermail followed by powermailpdf in the main TS template and see below for the mapping part of powermailpdf. I also added {downloadLink} in the RTE area for the receiver in the powermail content element and have email addresses entered there as well for the Receiver's Email and Sender's Email.
The only place I found the word mail in the docs was on this page, but it appears I don't need to do that since I'm using a powermail version greater than 3 right?
PS: I also posted this question as an issue for powermailpdf.
Relevant packages
typo3/cms-core 9.5.31
templavoilaplus/templavoilaplus 7.3.6
in2code/powermail 6.2.0
undkonsorten/powermailpdf 2.4.5
tmw/fpdm 2.9.2
TypoScript I'm using
plugin.tx_powermailpdf {
settings {
enablePowermailPdf = 1
showDownloadLink = 1
email.attachFile = 1
filelink {
jumpurl = 1
jumpurl.secure = 1
jumpurl.secure.mimeTypes = pdf=application/pdf
icon = 1
icon_link = 1
}
sourceFile = EXT:rapidfyre_estreetdrivingschool/Resources/Public/Forms/Student_Training_Record.pdf
fieldMap{
# Note the format is... pdfField = PowermailField
name = studentsname
address = address
city = city
state = state
zip = zip
gender = gender
home_number = homephone
alternate_number = alternatephone
student_cell = studentsphone
student_email = studentsemail
parent_name = parentsname
parent_email = parentsemail
high_school = highschool
birth_date = dateofbirth
permit_number = permitorid
class = class
# Hidden fields
orientation = orientation
}
}
}
Image of the first part of the error trace

EXT:powermailpdf is overriding this ViewHelper (Code).
config.tx_extbase {
objects {
In2code\Powermail\ViewHelpers\Misc\VariablesViewHelper.className = Undkonsorten\Powermailpdf\ViewHelpers\Misc\VariablesViewHelper
}
}
But the classes seems not match (in these versions):
https://github.com/einpraegsam/powermail/blob/6.2.0/Classes/ViewHelpers/Misc/VariablesViewHelper.php
https://github.com/undkonsorten/powermailpdf/blob/2.4.5/Classes/ViewHelpers/Misc/VariablesViewHelper.php
So, a call of this VH (possibly also from the normal Powermail templates) will hit a non-compatible version of the ViewHelper.

Related

Typo3 Typoscript additionalHeaders header location using variable

I try to redirect a link which is coming, but before part of the link should be replaced.
tmp.getSlug = TEXT
tmp.getSlug.data = getIndpEnv : TYPO3_REQUEST_URL
tmp.getSlug.replacement {
10 {
search = myLinkPart
replace = myNewLinkPart
}
}
config.additionalHeaders.10 {
header = Location: {tmp.getSlug}
}
So from: www.myUrl.de/test/myLinkPart/test2/
To: www.myUrl.de/test/myNewLinkPart/test2/
It must be inside Typoscript because of other conditions.
Does anybody has an idea?
you are mixing different objects in a non functional way.
First you define tmp.getSlug as a typoscript object. Then you try to use it as a data variable.
Additional everything beyond tmp. is not available at rendering time. (it just is available when the typoscript is scanned.)
If you want to use the evaluation of tmp.getSlug you need to assign it to a permanent object and then store it in a register so you can access it afterwards.
Additional you need a flexible object to compose the Location header, which by default just contains a string.
Either a text object where you can use data (which must be evaluated and stored in a register before) or a COA to compose the static and the dynamic string.
This might be a solution:
tmp.getSlug = TEXT
tmp.getSlug.data = getIndpEnv : TYPO3_REQUEST_URL
tmp.getSlug.replacement {
10 {
search = myLinkPart
replace = myNewLinkPart
}
}
config.additionalHeaders.10 {
header.cObject = COA
header.cObject {
10 = TEXT
10.value = Location:
20 < tmp.getSlug
}
}

linkhandler data attribute TYPO3 8

I would like to add a data attribute to the link handler on my website.
I have the following in my setup.ts:
config.recordLinks.test {
forceLink = 0
typolink {
parameter = #test
ATagParams = data-toggle="hover"
}
}
However, the data attribute does not arrive in the source code.
I have no more ideas why this could be. Everything else that is interpreted from https://docs.typo3.org/m/typo3/reference-coreapi/8.7/en-us/ApiOverview/LinkBrowser/Linkhandler/Index.html
Anyone have an idea?

Add formhandler field data to subject

My goal is to have the Formhandler log UID inside the Admin emails subject.
Inside of my email template I'm using
###value_tx_formhandler_log_inserted_uid### to insert a unique id.
I need to get this value into my Admin emails subject. E.g.
"Order ID: ###value_tx_formhandler_log_inserted_uid###"
I've read various forum posts, each do something different and I ended up with this snippet:
plugin.Tx_Formhandler.settings.predef.form {
# TEMPLATE MARKERS
name = Form1
templateFile = typo3template/typo3/ext/formhandler/form1/default.html
markers {
name = TEXT
name.value = Form1
}
finishers {
1.config {
class = Tx_Formhandler_Finisher_Mail
subject = TEXT
subject.value = ###GP:tx_formhandler_log_inserted_uid###
}
}
[...]
which just yields "{$formhandler.admin.subject}" as the subject.
I also tried other variations like
###LLL:tx_formhandler_log_inserted_uid### or tx_formhandler_log_inserted_uid
The backend field "subject" is empty.
Pasting the HTML placeholder into the backend field didn't work either.
I can't get this to work.
In what way can you access the id you want to insert?
From the notation GP:tx_formhandler_log_inserted_uid I would assume a GET/POST value.
For using this value in typoscript you need to do it like this (or similar: dataWrap):
subject = TEXT
subject.data = GP:tx_formhandler_log_inserted_uid
subject.noTrimWrap = |Order ID: ||
The notation LLL:tx_formhandler_log_inserted_uid would be a language specific text (you would also insert by .data) but it would be a static text for each language.
After a lot of trial and error, I got it working.
First of all, I forgot to specify that I want to configure the admin mail.
Adding admin { fixed the problem of getting only {$formhandler.admin.subject}.
The UID value itself can be accessed with GP:formhandler|tx_formhandler_log_inserted_uid
I combined that with the noTrimWrap as suggested by #bernd-wilke-πφ
The final snippet looks like this:
finishers {
1 {
class = Tx_Formhandler_Finisher_Mail
config {
admin {
subject = TEXT
subject.data = GP:formhandler|tx_formhandler_log_inserted_uid
subject.noTrimWrap = |Order number: ||
}
}
}
}

Typo3 formhandler validate email suffix

i installed the Typo3 extension "Formhandler" and everything is working.
But i have the wish tha a Form can only be send if the E-Mail suffix is equal to 3 others.
Example,
my Form have a field "Email: _______",
and the Form should only be submitted if the Field contains
<something>#support.example.com
<something>#web.example.com
<something>#news.example.com
How can i do this?
You can do this with the pregMatch error check.
validators {
1.class = Validator_Default
1.config.fieldConf {
email.errorCheck {
1 = pregMatch
1.value = /\b[A-Za-z0-9._%-]+#(support|web|news)+\.(example)+\.(com)\b/
}
}
}

Confirmation page for Form submit?

in Typo3 6.1 how can I define a confirmation page ("Your request has been sent") afert a form has been submitted?
In Version 6.0 there was an option Target Page in the Behaviour tab of the form - but I cant find something similar in version 6.1...
You can set the success-message by adding
messages.success = TEXT
messages.success.value = Testsuccess
To postProcessor.1
Complete code:
postProcessor {
1 = mail
1 {
recipientEmail = recipient#email
senderEmail = sender#email
subject = Testmail
messages.success = TEXT
messages.success.value = Testsuccess
}
}
You can also define messages.error, if something went wrong.