original_string: public static function factory(EventRegistration $registration) {
  		$email      = new self();
  		$siteconfig = SiteConfig::current_site_config();
  
  		$email->setTo($registration->Email);
  		$email->setSubject(sprintf(
  			'Registration Details For %s (%s)',
  			$registration->Event()->Title,
  			$siteconfig->Title));
  
  		$email->populateTemplate(array(
  			'Registration' => $registration,
  			'SiteConfig'   => $siteconfig
  		));
  
  		singleton(get_class())->extend('updateEmail', $email, $registration);
  		return $email;
  	}
code: public static function factory(EventRegistration $registration) {
  		$email      = new self();
  		$siteconfig = SiteConfig::current_site_config();
  
  		$email->setTo($registration->Email);
  		$email->setSubject(sprintf(
  			'Registration Details For %s (%s)',
  			$registration->Event()->Title,
  			$siteconfig->Title));
  
  		$email->populateTemplate(array(
  			'Registration' => $registration,
  			'SiteConfig'   => $siteconfig
  		));
  
  		singleton(get_class())->extend('updateEmail', $email, $registration);
  		return $email;
  	}
code_tokens: public static function factory ( EventRegistration $ registration ) { $ email = new self ( ) ; $ siteconfig = SiteConfig :: current_site_config ( ) ; $ email -> setTo ( $ registration -> Email ) ; $ email -> setSubject ( sprintf ( 'Registration Details For %s (%s)' , $ registration -> Event ( ) -> Title , $ siteconfig -> Title ) ) ; $ email -> populateTemplate ( array ( 'Registration' => $ registration , 'SiteConfig' => $ siteconfig ) ) ; singleton ( get_class ( ) ) -> extend ( 'updateEmail' , $ email , $ registration ) ; return $ email ; }
docstring: Creates an email instance from a registration object.
  
  @param  EventRegistration $registration
  @return EventRegistrationDetailsEmail
docstring_tokens: Creates an email instance from a registration object .