Typo3 Powermail form - Send Page UID to receiver - forms

I've created a small application form for my website. Everything works fine.
In the plugin settings there is a field called "Bodytext for Email to Receiver". This is the the mail I get, everytime somebody fills out an application form. It looks like this right now:
New application arrived!
{powermail_all}
Is it possible to get the Page UID from the application form into a variable to put it in there?
The only solutions I've found need TypoScript. Is there any other way?

The solution with typoscript should be (according to manual):
use in template:
{f:cObject(typoscriptObjectPath:'lib.pageuid')}
define the typoscript:
lib.pageuid = TEXT
lib.pageuid.data = page:uid
I'm not sure about an additional variable for {powermail_all} as I'm not familiar with the extension.
If I understand the manual correctly this might be possible with :
plugin.tx_powermail {
settings {
setup {
manipulateVariablesInPowermailAllMarker {
// possible sections (define for each, where you need it):
// confirmationPage, submitPage, receiverMail, senderMail, optinMail
submitPage {
pageUid = TEXT
pageUid.data = page:uid
}
senderMail {
pageUid = TEXT
pageUid.data = page:uid
}
}
}
}
}

Related

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: Special tt_contenttype. Modify content before output

Can I create a "special" type of tt_content, so text is beeing processed in some custom ways before outputtet?
In my case I would like to add ###MY_MARKER### somewhere in header and/or bodytext and have it replaced by the right words for the given page.
eg:
When visiting this page: mypage.com/?marker=test
Header in tt_content: "Welcome to ###MY_MARKER##, enjoy
Output in browser: "Welcome to TEST, enjoy"
I CAN do it by making a custom plugin. Question is more if I can reuse normal tt_contant for the same purpose
Yes, you can easily extend the tt_content by adding your own TCA configuration to the typo3conf/extTables.php file:
t3lib_div::loadTCA('tt_content');
$TCA['tt_content']['columns']['CType']['config']['items']['user_my_type'] = array(
0 => 'My custom content',
1 => 'user_my_type',
2 => 'i/tt_content.gif',
);
$TCA['tt_content']['ctrl']['typeicon_classes']['user_my_type'] = 'mimetypes-x-content-text';
$TCA['tt_content']['ctrl']['typeicons']['user_my_type'] = 'tt_content.gif';
/* In the following either copy, insert and modify configuration from some other
content elemenet (you can find it in the ADMIN TOOLS -> Configuration - $TCA)... */
$TCA['tt_content']['types']['user_my_type']['showitem'] = '';
/* ...or assign it some other configuration so that it's exactly the same
as some other content type and stays the same after some update of TYPO3: */
$TCA['tt_content']['types']['user_my_type']['showitem'] = $TCA['tt_content']['types']['text']['showitem'];
After that, just set in your Typoscript template how the element is supposed to be rendered:
tt_content.user_my_type = COA
tt_content.user_my_type {
10 = TEMPLATE
10 {
template = TEXT
template.field = header
marks {
MY_MARKER = TEXT
MY_MARKER.value = TEST
}
}
20 = TEMPLATE
20 {
template = TEXT
template {
field = bodytext
required = 1
parseFunc = < lib.parseFunc_RTE
}
marks < tt_content.user_my_type.10.marks
}
}
NOTES
The Typoscript rendering is just a simplified example. You might want to add other standard configuration like in other elements, e.g. the one that adds edit icons for frontend display.
The marker in my example can be populated by the value of a GET paramater in the URL as you wanted but this would have nasty security implications. You would certainly need very good validation of that input.

Typoscript: Display register value as text

I'm using the extension seo_dynamic_tag, which is a fantastic plugin for TYPO3 SEO purposes.
It uses registers to store the generated meta description and keywords. Later on in the script, the page metadata is filled in from these registers:
page {
meta {
description {
field >
data = register:description
}
keywords {
field >
data = register:keywordss
}
}
1000 < temp.seo
}
So far it works like charm.
But in addition I'd like to display a TEXT object on the page with the meta description on the bottom. The text should read the meta description and some other stuff. That's where I need your help.
I tried to do the "magic" like this:
temp.description = COA
temp.description {
10 = TEXT
10.value = Meta description: {register:description}
stdWrap.insertData = 1
}
lib.footer < temp.description
This simply does not work. If I want to display something else, for example {page:title} or {date:y-m-d}, data insertion works. For register:xxx it doesn't.
I already spent lots of hours to google out my desired solution, but no success :(
Do you have any idea what I'm missing here?
I'm using TYPO3 4.5.3 (I know I should update ;)).
Many thanks in advance for your help! :)
Your stdWrap.insertData = 1 is applied to your COA-object, and not to your TEXT-object. You can instead set 10.insertData = 1 or just write the following:
10 = TEXT
10.data = register:description

Typo3 - Custom email newsletters with direct_mail

Im building a newsletter and the start is like this:
DEAR ###USER_gender### ###USER_first_name### ###USER_last_name###
which outpouts
DEAR ###USER_gender### JOHN DOE
and I was hoping it would replace the gender mark with "Miss" and "Sir", depending on the value. How could I do this?
Extra fields have to be added to the field list (see docu). But I'm not sure whether this automatically works with non-string fields. Maybe using a hook is your solution or using another extension which adds a new field to tt_address.
Another solution is to nest marker:
###GENDER_###USER_gender######
and then warp you content in a new template object:
10 = TEMPLATE
10 {
template < yourAlreadyProcessedContent
marks {
GENDER_m = TEXT
GENDER_m.value = Sir
}
}
It's a bit unusual, but sometimes it's very useful.
(Personally I use it to replace version numbers in tt_content records.)
Edit:
Example for Dbugger:
Download the Introduction Package and install it. After that add to the Welcome page a new template record with the following steup:
temp.mainTemplate = TEMPLATE
temp.mainTemplate {
template = TEXT
template.value = (
Foo
###CONTENT###
###CONTENT###
Bar
)
subparts {
CONTENT < styles.content.get
}
}
page = PAGE
page {
typeNum = 0
10 = TEMPLATE
10 {
template < temp.mainTemplate
marks {
TEST = TEXT
TEST.value = ok
}
}
Now include CSS Styled Contnet and enable the following options:
clear constants, clear setup, rootlevel
The output should look like that:
Foo
Congratulations ...
Bar
If you add ###TEST### to the the tt_content record on the welcome page it will be replaced with ok.
This should work with direct mail, too.
Edit:
I'm sorry, this only works which normal extension which are use in the rendering process.
a little bit late, but here's the best solution for the salutation in direct_mail & tt_address .. works perfect for me. The personalized marker is just ###USER_salutation###,
https://blog.webentwickler.at/individuelle-marker-in-direct-mail/