1

I'm quite new to typoscript and I want to use an array to associate a subject to an email adress like this

email_mapper {
   general = info@somewhere.com
   specific = me@somewhere.com
}

to_mail = email_mapper[GP:formhandler|subject]

how can I do something like that in typoscript? Is it possible at all?

Community
  • 1
  • 1

1 Answers1

1

You can do that using the CASE content object. It would look somehow like this:

to_mail = CASE
to_mail {
    key.data = GP:formhandler|subject

    general = TEXT
    general.value = info@somewhere.com

    specific = TEXT
    specific.value = me@somewhere.com

    default = TEXT
    default.value = catchall@somewhere.com
}

I haven't tested the above code, but something along these lines will work.

Jost
  • 5,948
  • 8
  • 42
  • 72