{"id":19052009,"url":"https://github.com/rdelbem/wp-mailer-class","last_synced_at":"2026-04-17T14:37:31.076Z","repository":{"id":65554640,"uuid":"386045045","full_name":"rdelbem/WP-mailer-class","owner":"rdelbem","description":null,"archived":false,"fork":false,"pushed_at":"2023-06-19T01:23:00.000Z","size":26,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-28T08:50:37.833Z","etag":null,"topics":["email","mail","wordpress"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rdelbem.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-14T18:51:21.000Z","updated_at":"2023-10-05T02:47:51.000Z","dependencies_parsed_at":"2024-11-24T12:19:27.452Z","dependency_job_id":null,"html_url":"https://github.com/rdelbem/WP-mailer-class","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/rdelbem/WP-mailer-class","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdelbem%2FWP-mailer-class","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdelbem%2FWP-mailer-class/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdelbem%2FWP-mailer-class/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdelbem%2FWP-mailer-class/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rdelbem","download_url":"https://codeload.github.com/rdelbem/WP-mailer-class/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdelbem%2FWP-mailer-class/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":284045913,"owners_count":26938122,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-12T02:00:06.336Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["email","mail","wordpress"],"created_at":"2024-11-08T23:20:32.450Z","updated_at":"2025-11-12T14:02:15.109Z","avatar_url":"https://github.com/rdelbem.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Simple WordPress Mailer class\n\nThe intention of this snippet is to facilitate the use of wp_mail native function.\nNormally, when using, wp_mail, some parameters are required in order for it to work: headers, subject, body etc.\n\nIf all you have is the user id, you will need to use other WordPress function to get the email and, only then, pass it to wp_mail. While, coding a plugin or a theme, this will require a different file and class, as calling all this wp functions will, most certanly, make a mess in your code.\n\nHowever, if you use WPMailerClass, you only need to provide ONE relevant receiver data, id OR email. See the examples:\n\nHere, only id is provided\n\n```php\n$send_mail = new WPMailerClass( 1, 'Amazing subject!', 'Amazing message!' );\n$send_mail-\u003esendEmail();\n```\n\nHere, only e-mail is provided\n\n```php\n$send_mail = new WPMailerClass( 'youruser@mail.com', 'Amazing subject!', 'Amazing message!' );\n$send_mail-\u003esendEmail();\n```\n\nAnd if you want to defensive handle errors you can do the following\n\n```php\n$send_mail = new WPMailerClass( 'youruser@mail.com', 'Amazing subject!', 'Amazing message!' );\n$result = $send_mail-\u003esendEmail();\n\nif($result instanceof WP_Error){\n    error_log($result-\u003eget_error_message()); // this will log 'WPMailerClass could not send email'\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frdelbem%2Fwp-mailer-class","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frdelbem%2Fwp-mailer-class","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frdelbem%2Fwp-mailer-class/lists"}