jhayvon brutal
jhayvon brutal

Reputation: 17

how to add image in wordpress custom plugin?

this is the directory of my project

Turover-calculator
  assets
    logo.png
  turnover-calculator.php


wp_mail($comEmail, $comName." turnover cost result ", "the total attrition cost of the ".$comName." is ".$currency.$result . '<img src = ' . plugins_url('/assets/logo.png', __FILE__) . ' style="height: 100%; width: 100%; object-fit: contain" alt="logo">');

logo.png not showing guess i call the img wrong

Upvotes: 0

Views: 1209

Answers (1)

JsonKnight
JsonKnight

Reputation: 205

try this one plugin_dir_url( __DIR__ )

$img_path = '<img src = ' . plugin_dir_url( __DIR__ ) . 'assets/logo.png' . ' style="height: 100%; width: 100%; object-fit: contain" alt="logo">';
wp_mail($comEmail, $comName." turnover cost result ", "the total attrition cost of the ".$comName." is ".$currency.$result . $img_path);

Upvotes: 1

Related Questions