Userforms additional email template

Silverstripe Version:

Question:

Hi. Trying to add an additional email template for the userforms module. It appears that you can have more than one (given that it’s a dropdown in the recipients area) but there’s no documentation for adding an additional template.

I know how to over-ride what’s there, but that’s not what I’m trying to do.

Can somebody point me in the right direction?

// Include any relevant code. If you have a lot of code, link to a gist instead.

I’ve just “solved” this issue myself. So much of the documentation around SS4 is outright wrong. I can’t believe that developers are working on SS5 when so much of SS4 doesn’t work. But anyway. The answer is to add the following to your /app/_config/mysite.yml file (where app/templates/email/ is the path to where you want your email templates to be found)

SilverStripe\UserForms\Model\UserDefinedForm:
   email_template_directory: app/templates/email/

This /should/ add the files found to the dropdown list of email templates

1 Like

If you’ve found an error in the docs it would be great if you can take some time to fix it for others. SilverStripe is open source, so you have the power to improve it :slight_smile:

This worked for me. Thank you.

HI JonoM,

It’s not a single error. It the fact the the lessons no longer work with the latest “stable” version of SilverStripe. https://www.silverstripe.org/learn/lessons/v4/creating-your-first-project

This is the first steps a developer would take if they want to learn how to use silverstripe and the lesson fails. You cannot remove the theme directory because the Requirements code looks inside it for the css and js files.

I cannot alter the lessons, or even comment that they no longer work. If you feel like fixing them so that they actually work that’d be great, and help people who want to learn how to use SilverStripe.

Lets take this from the very first paragraph of the very first lesson that someone is supposed to learn

In a default installation of SilverStripe, your project directory is called mysite/ , and lives in the project root. Your theme directory, however, will be located one level deeper, under the themes/ folder. Because the code layer is detached from the UI, a given project can have multiple themes.

There is no /mysite/ directory any more. It’s now /app/. Ok, that’s fine. And I can already hear you saying “Well, why don’t I fix it?”. Because I didn’t break it. Someone at silverstripe chose to make this breaking change. That’s the person who should fix the documentation, so that, at the very least, they will learn that making breaking changes is a pain in the a** for the rest of us. And maybe, just maybe, they’ll be less inclined to make breaking changes next time. However, the fact that SS 4.1 introduced breaking changes, and 4.2 introduces breaking changes, and I’m darn certain that SS 5 will break all manner of shit, that I’m talking to deaf ears, and no-one will care.

Developers, module maintainers and everyone except the main SS dev team, want a stable platform. One where something I learn last year still works! Not something that they need to relearn every 6 months because some dev thought it’d be a neat idea to change the location of every file, or remove $themeDir because one in a hundred people want to use a multi-theme. Or requiring SSH access on the server to deploy SS (effectively preventing anyone on a shared platform from even trying SS).

/rant

1 Like

Hi,

Issues with the lessons can be reported here: Issues · silverstripe/silverstripe-lessons-v4 · GitHub