Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

[feature] add hook to parse simple tokens #7445

Closed
Zeromax opened this issue Nov 17, 2014 · 8 comments
Closed

[feature] add hook to parse simple tokens #7445

Zeromax opened this issue Nov 17, 2014 · 8 comments
Labels

Comments

@Zeromax
Copy link

Zeromax commented Nov 17, 2014

Is it possible to get a hook in the \String::parseSimpleTokens() function?

public static function parseSimpleTokens($strString, $arrData)

I would suggest to optional add the Module Object to the function:

public static function parseSimpleTokens($strString, $arrData, $objModule = null)

All arguments should be passed to the hook and expect $arrData as a return value.

Any other ideas or better suggestion?

@Toflar
Copy link
Member

Toflar commented Nov 17, 2014

What for?

@Zeromax
Copy link
Author

Zeromax commented Nov 17, 2014

To add more tokens to the newsletter subscription mails or the registration mails. Or each core Module which is using the simple tokens. See also #7446 and #7101. In the future this would work like a charm ;)

I want to add some custom things to those mails/text. And for know it is only possible, to add static content which does not work all the time. Or is hard to replace it and so on.

@aschempp
Copy link
Member

Well $objModule does not make sense because everyone can use the routine without having a module. It would be $context or something.

@Zeromax
Copy link
Author

Zeromax commented Nov 18, 2014

@aschempp That's right it could be called from anywhere... Haven't thougt about that.

@Zeromax
Copy link
Author

Zeromax commented Feb 16, 2015

Any Statement to the Feature?

@aschempp
Copy link
Member

On the topic of adding more tokens to the newsletter etc, I think parseSimpleTokens would be the wrong place. There are already hooks in Isotope to do that, and if you need them at other places then they should be added there. Because then the context can always be correct and possibly contain more information.

@Zeromax
Copy link
Author

Zeromax commented Feb 17, 2015

Thanks for your Reply.

So if I get it right you say, that it is better to have a hook inside the module, before the Data is parsed?
That sounds good. Shall I make a new Issue for that and Close this one?

@aschempp
Copy link
Member

I don't think a new issue is necessary.

Btw, you should take a look at our notification center, where you can also send registration mails etc but using backend templates.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants