Cathcing Send Mails?

How can i catch website sending mails? Any hook or function? I want to store all mail data how can i do that?

Use the 'send_mail' php hook.

If you just want to log what is sent to customers, then you can use our Email Logging addon.

The addon will log the time, who the email was sent to and the subject in the standard system logs (Administration/Logs).

i check your addon mate. i dont want logging only i will try store all mails. ant merge with an notificaiton system

init php

fn_register_hooks(
    'send_mail',
    'send_mail_pre'
);

func php

function fn_my_changes_send_mail($mailler)
{
    return $mailler;

}

but how i will catch this globally ? with out dispatch?

Hooks have nothing to do with dispatch. When the Mailer method send() is called, then the send_mail registrations are scanned and those functions are called. You need to read up on how hooks work in cs-cart.

I read documents mate

Then this way must be correct right?

You would get a fatal error since fn_my_changes_send_mail_pre() is not a function. But in general, yes, you register the hook and then handle it in an structured named function.

Thank you bro i understand hook usage

stilli am getting blank page error

fn_register_hooks(
        'send_mail'
    );

hook registered

function fn_customer_notifications_send_mail($transport, $message, $area, $lang_code)
   {
       $body = $message->getBody();
       $from = $message->getFrom();
       $to = $message->getTo();
   fn_set_notification('N', __('notice'), $to);

}

also added namespace use Tygh\Mailer;

i tyr with

function fn_customer_notifications_send_mail($message)

nothing

just i need catch user_id, subject, body, and to

anyone help ?

i am getting with send_mail_pre hook but send_mail how can get this data ?

with send_mail hoks getting

session_start(): Failed to decode session object. Session has been destroyed

error

i get what i want values via mailer_send_post i hope its the true way

interestin begin worked. thank you all