Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Calling the $site_name variable from a module in Drupal 7

I'm creating a custom module that has uses the form API and sends an email on submission- however, I want to make the 'from' email name to be the site name (eg, <My Drupal Site> [email protected]). In phptemplate you can use $site_name, but that doesn't work from a module it seems. I've tried calling &$variables or &$variable or &$vars in the function argument and DSMed it but still nothing. Any ideas?

Many thanks! Matt

like image 905
Matt Fletcher Avatar asked Nov 03 '11 10:11

Matt Fletcher


1 Answers

You can use:

variable_get('site_name');

anywhere in a module or template file :)

like image 151
Clive Avatar answered Nov 02 '22 23:11

Clive