I'd like to be able to set the domain email address upon creation of a new domain? I've looked in the domain rules options on creation of a new domain however there is only an option for Domain URL and Domain Site Name. How easy would it be to add email address to this rule?

Comments

jeremymcminn’s picture

WOuld this be done with the variable site_mail ?

I've added this option to the domain settings form on the rules create domain action, except it doesn;t seem to pass through when creating the domain, it just uses the default email address.

jeremymcminn’s picture

I'd also like to add node front page automatically too.

I've been looking at site_mail with $domain_conf - unsure as to what I am doing wrong with the code here. Domain gets created but email address doesn't update.

function domain_rules_actions_create_domain($sitename, $subdomain, $site_mail, $scheme, $valid) {

  $domain = domain_lookup(NULL, $subdomain, TRUE);

  if ($domain['domain_id']) {
    drupal_set_message(t('The domain %domain already exists.', array('%domain' => $subdomain)), 'error');
  }
  else {
    $schemes = __domain_rules_schemes();
    $scheme  = isset($schemes[$scheme]) ? $schemes[$scheme] : '';
    unset($schemes);
    $domain_settings = array(
      'subdomain' => $subdomain,
      'sitename' => $sitename,  
      'scheme' => $scheme,
      'valid' => $valid);    
     $domain_conf = array(
     'site_mail' => $site_mail);
    $domain = domain_save($domain_settings, $domain_conf, FALSE);
    unset($domain_settings, $domain_conf);
    if ($domain['domain_id']) {
      drupal_set_message(t('The domain %domain created successfully.', array('%domain' => $subdomain)));
    }
    else {
      drupal_set_message(t('Failed to create the domain %domain.', array('%domain' => $subdomain)), 'error');
    }
  }
}

shushu’s picture

Status: Active » Postponed (maintainer needs more info)

Sorry I missed this issue.
Do you still need those features ?
Regards,
Shushu

jeremymcminn’s picture

Hi Shushu

Yes I am still looking to add that feature, as well as setting domain frontpage too, not sure if you are able to help with this in anyway?

Thanks

jeremymcminn’s picture

Hi

I was just wondering if there is simple code I can do to set the email address?

Ideally I want someone to be able to register as a user, create their domain, assign them to it and set the domain email as their user account email.

If anyone has any ideas how I could do this it would be much appreciated.

Thanks

bmx269’s picture

I too am looking for a way to use rules to set the other default site settings, like slogan, email, front page, etc. Thanks for you awesome work.

shushu’s picture

Assigned: Unassigned » shushu
Status: Postponed (maintainer needs more info) » Fixed

Added new "Set a domain variable" action, which can be used to set any variable for a domain.
It can be used to set all of the values asked in this issue, as far as I understand.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.