You are here

function social_swiftmail_get_logo in Open Social 8.8

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_swiftmail/social_swiftmail.module \social_swiftmail_get_logo()
  2. 8 modules/social_features/social_swiftmail/social_swiftmail.module \social_swiftmail_get_logo()
  3. 8.2 modules/social_features/social_swiftmail/social_swiftmail.module \social_swiftmail_get_logo()
  4. 8.3 modules/social_features/social_swiftmail/social_swiftmail.module \social_swiftmail_get_logo()
  5. 8.4 modules/social_features/social_swiftmail/social_swiftmail.module \social_swiftmail_get_logo()
  6. 8.5 modules/social_features/social_swiftmail/social_swiftmail.module \social_swiftmail_get_logo()
  7. 8.6 modules/social_features/social_swiftmail/social_swiftmail.module \social_swiftmail_get_logo()
  8. 8.7 modules/social_features/social_swiftmail/social_swiftmail.module \social_swiftmail_get_logo()
  9. 10.3.x modules/social_features/social_swiftmail/social_swiftmail.module \social_swiftmail_get_logo()
  10. 10.0.x modules/social_features/social_swiftmail/social_swiftmail.module \social_swiftmail_get_logo()
  11. 10.1.x modules/social_features/social_swiftmail/social_swiftmail.module \social_swiftmail_get_logo()
  12. 10.2.x modules/social_features/social_swiftmail/social_swiftmail.module \social_swiftmail_get_logo()

Function the fetches the logo.

1 call to social_swiftmail_get_logo()
social_swiftmail_preprocess_swiftmailer in modules/social_features/social_swiftmail/social_swiftmail.module
Preprocess swift template.

File

modules/social_features/social_swiftmail/social_swiftmail.module, line 130
Module file for Social Swiftmailer.

Code

function social_swiftmail_get_logo($theme_id) {
  global $base_url;

  // Default we use the logo image.
  $logo = $base_url . theme_get_setting('logo.url', $theme_id);

  // It could be overridden here.
  $email_logo = theme_get_setting('email_logo', $theme_id);

  // Must be a non-empty array.
  if (is_array($email_logo) && !empty($email_logo)) {
    $file = File::load($email_logo[0]);
    if ($file instanceof File) {
      $logo = file_create_url($file
        ->getFileUri());
    }
  }
  return $logo;
}