[TYPO3-english] How to create an email address dynamically using ts and getIndpEnv:TYPO3_HOST_ONLY
Matthew K - (Swagman Solutions)
typo3 at swagmansolutions.com.au
Sun Jul 19 10:08:40 CEST 2009
Hi Peter,
Thanks for your suggested ts below, it appears to have worked. :) I'll have
to read a little more into the tsref & tsbyex manuals to learn what your ts
is doing.
Getting the email address to use TYPO3 anti spam in its output is for
another day.
Its a shame that there isn't an enviroment variable, (that i could find
online or in my TYPO3 handbook), that could return just the doamin of
HOST_ONLY, ie thats strips off any http, https, ftp and/or www
I can imagine that there are other times that it would come in handy when
trying to dynamically creat email addresses.
Perhaps in the future there might be a IndpEnv for TYPO3_HOST_DOMAIN_ONLY or
something like this.
Thanks again
Matthew K
Swagman Solutions
Peter Klein wrote:
> Hi Matt.
>
> Try this:
>
> 10 = TEXT
> 10.data = getIndpEnv:TYPO3_HOST_ONLY
> 10.wrap = info@|
> 10.split {
> token = .
> cObjNum = 1 || || 2
> 1.current = 1
> 1.if.value = www
> 1.if.equals.current = 1
> 1.if.negate = 1
> 1.wrap = |.
>
> 2.current = 1
> 2.wrap = .|
> }
>
>
> "Matt K - [SwagmanInternet]" <typo3 at swagmaninternet.com> wrote in
> message
> news:mailman.1.1247906308.9020.typo3-english at lists.netfielders.de...
>> Hi,
>>
>> I am trying to create an email address dynamically using ts and
>> getIndpEnv:TYPO3_HOST_ONLY
>>
>> I was hoping to be able to split/remove the 'www' off leaving only
>> the 'domain.com.au' that I could then use 'wrap' and prefix it with info@
>> eg: info at domain.com.au
>>
>> This is the typoscript I have so far:
>>
>> page.10.subparts.EMAIL_ADDRESS.data = getIndpEnv:TYPO3_HOST_ONLY
>> page.10.subparts.EMAIL_ADDRESS.split {
>> token = .
>> cObjNum = 1
>> 1.current = 1
>> 1.wrap = info@|
>> }
>>
>> but its output is:
>>
>> info at wwwinfo@domaininfo at cominfo@au
>>
>>
>> Any suggestions appreciated?
>>
>> Kind regards,
>>
>> Matt
More information about the TYPO3-english
mailing list