Button to mail

QuestionsButton to mail
JOEL GOMES asked 9 years ago

Hi i need to add in my grid a button who send an email with attachment and some filds on the grid, theres some easy way do this? or example code?

Thank you

1 Answers
Abu Ghufran answered 9 years ago

Hello,

If you need button with each row, easiest solution would be to make a virtual column that has hyperlink to your php page with all row data as querystring.

In that page, you can have code to email and get row data from querystring.

You can use column name placeholder in url: id={id}&col2={col2}&col3={col3}

# Custom made column to show link, must have default value as it's not db driven
$col = array();
$col["title"] = "Email";
$col["name"] = "email";
$col["width"] = "30";
$col["align"] = "center";
$col["search"] = false;
$col["sortable"] = false;
# no new line in this html, only space. otherwise it may break ui of grid
$buttons_html = "<a target='_blank' href='email.php?id={id}&col2={col2}&col3={col3}' style='text-decoration:none; white-space:none; border:1px solid gray; padding:2px; position:relative; width:25px; color:red'>Email</a>";
$col["default"] = $buttons_html;
$cols[] = $col;

Your Answer

9 + 0 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?