I am creating a custom module that uses the form API and sends an email when submitted. However, I want the name "from" to be named with the site name (for example, <My Drupal Site> no -reply@myhttphost.com ). In phptemplate you can use $ site_name, but this does not work with the module. I tried calling the $ variables and the $ am or $ vars variables in the function argument and DSMed, but still nothing. Any ideas?
Many thanks! Matt
You can use:
variable_get('site_name');
anywhere in a module or template file :)
I would suggest the approach used in the kernel:
variable_get('site_name', 'Drupal');
It is good practice to include a default value in variable_get() .
variable_get()
Done ... I dug up the kit and got the code, and none of this is disinfected ... sanitizing serialized objects will probably break the material, so it makes sense
Source: https://habr.com/ru/post/900685/More articles:Using MDC in log4j for a dynamic log file name - javajQuery validating form name with square brackets - jqueryJQuery selectors - in order of speed - performanceHow to send non-ASCII characters using httplib when content-type is "application / xml" - pythonAndroid PCM for Uaw encoding wav file - javajsf output html-formatted text - jsfHow to make Maven resource file copied to WEB-INF / lib directory? - javaHow to get current NHibernate session object from ActiveRecord SessionScope lock - objectHow can I return IEnumerable from the method - collectionsIs it possible @XmlElement to annotate a method with a non-standard name? - javaAll Articles