{"id":1875,"date":"2025-09-18T09:21:34","date_gmt":"2025-09-18T09:21:34","guid":{"rendered":"https:\/\/aleksandermilisenko23.thkit.ee\/wp\/?page_id=1875"},"modified":"2025-09-18T09:31:36","modified_gmt":"2025-09-18T09:31:36","slug":"h10-send-mail-on-push","status":"publish","type":"page","link":"https:\/\/aleksandermilisenko23.thkit.ee\/wp\/h10-send-mail-on-push\/","title":{"rendered":"H10: Send mail on push"},"content":{"rendered":"\n<p>Final YML<\/p>\n\n\n\n<p>Esimeseks me peame looda Github Secrets oma username&#8217;i ja salas\u00f5naga<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"335\" height=\"234\" src=\"https:\/\/aleksandermilisenko23.thkit.ee\/wp\/wp-content\/uploads\/2025\/09\/B3973493-EFB0-45F5-A6F3-D2D7C0A8EA8C.png\" alt=\"\" class=\"wp-image-1878\" srcset=\"https:\/\/aleksandermilisenko23.thkit.ee\/wp\/wp-content\/uploads\/2025\/09\/B3973493-EFB0-45F5-A6F3-D2D7C0A8EA8C.png 335w, https:\/\/aleksandermilisenko23.thkit.ee\/wp\/wp-content\/uploads\/2025\/09\/B3973493-EFB0-45F5-A6F3-D2D7C0A8EA8C-300x210.png 300w, https:\/\/aleksandermilisenko23.thkit.ee\/wp\/wp-content\/uploads\/2025\/09\/B3973493-EFB0-45F5-A6F3-D2D7C0A8EA8C-150x105.png 150w\" sizes=\"auto, (max-width: 335px) 100vw, 335px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"789\" height=\"205\" src=\"https:\/\/aleksandermilisenko23.thkit.ee\/wp\/wp-content\/uploads\/2025\/09\/5DA7333B-2388-4383-92B8-7E1425A3FAF6.png\" alt=\"\" class=\"wp-image-1879\" srcset=\"https:\/\/aleksandermilisenko23.thkit.ee\/wp\/wp-content\/uploads\/2025\/09\/5DA7333B-2388-4383-92B8-7E1425A3FAF6.png 789w, https:\/\/aleksandermilisenko23.thkit.ee\/wp\/wp-content\/uploads\/2025\/09\/5DA7333B-2388-4383-92B8-7E1425A3FAF6-300x78.png 300w, https:\/\/aleksandermilisenko23.thkit.ee\/wp\/wp-content\/uploads\/2025\/09\/5DA7333B-2388-4383-92B8-7E1425A3FAF6-768x200.png 768w, https:\/\/aleksandermilisenko23.thkit.ee\/wp\/wp-content\/uploads\/2025\/09\/5DA7333B-2388-4383-92B8-7E1425A3FAF6-150x39.png 150w\" sizes=\"auto, (max-width: 789px) 100vw, 789px\" \/><\/figure>\n\n\n\n<p>P\u00e4rast seda loome &#8220;.github&#8221; kaust kui seal pole ja &#8220;worklflows&#8221; kaust<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#282A36\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#f6f6f4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>mkdir .github\ncd .github\nmkdir workflows<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dracula-soft\" style=\"background-color: #282A36\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #E7EE98\">mkdir .github<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E7EE98\">cd .github<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E7EE98\">mkdir workflows<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>V\u00f5i loome githubis nuppi abil ( New workflow )<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"326\" height=\"88\" src=\"https:\/\/aleksandermilisenko23.thkit.ee\/wp\/wp-content\/uploads\/2025\/09\/B7CEEC1B-A609-46A6-9547-8B9128E11EE8.png\" alt=\"\" class=\"wp-image-1880\" srcset=\"https:\/\/aleksandermilisenko23.thkit.ee\/wp\/wp-content\/uploads\/2025\/09\/B7CEEC1B-A609-46A6-9547-8B9128E11EE8.png 326w, https:\/\/aleksandermilisenko23.thkit.ee\/wp\/wp-content\/uploads\/2025\/09\/B7CEEC1B-A609-46A6-9547-8B9128E11EE8-300x81.png 300w, https:\/\/aleksandermilisenko23.thkit.ee\/wp\/wp-content\/uploads\/2025\/09\/B7CEEC1B-A609-46A6-9547-8B9128E11EE8-150x40.png 150w\" sizes=\"auto, (max-width: 326px) 100vw, 326px\" \/><\/figure>\n\n\n\n<p>P\u00e4rast k\u00f5ik, me loome yaml faili ja sisestame j\u00e4rgmine<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#282A36\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#f6f6f4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>name: Send Mail on Push\n\non:\n  push:\n    branches:\n      - main\n\njobs:\n  send-email:\n    runs-on: ubuntu-latest\n\n    steps:\n      - name: Checkout code\n        uses: actions\/checkout@v2\n\n      - name: Send email\n        uses: dawidd6\/action-send-mail@v3\n        with:\n          server_address: smtp.gmail.com\n          server_port: 587\n          username: ${{ secrets.MAIL_USERNAME }}\n          password: ${{ secrets.MAIL_PASSWORD }} \n          subject: 'Push tehtud: ${{ github.repository }}'\n          body: |\n            Tere!\n\n            Kehtestuse tegi: ${{ github.event.pusher.name }}\n            Kehtestuse s\u00f5num: ${{ github.event.head_commit.message }}\n\n            Repo: ${{ github.repository }}\n          to: 'doe481157@gmail.com'\n          from: ${{ secrets.MAIL_USERNAME }}<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dracula-soft\" style=\"background-color: #282A36\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #97E1F1\">name<\/span><span style=\"color: #F286C4\">:<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #E7EE98\">Send Mail on Push<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #BF9EEE\">on<\/span><span style=\"color: #F286C4\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">  <\/span><span style=\"color: #97E1F1\">push<\/span><span style=\"color: #F286C4\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">    <\/span><span style=\"color: #97E1F1\">branches<\/span><span style=\"color: #F286C4\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">      <\/span><span style=\"color: #F286C4\">-<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #E7EE98\">main<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #97E1F1\">jobs<\/span><span style=\"color: #F286C4\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">  <\/span><span style=\"color: #97E1F1\">send-email<\/span><span style=\"color: #F286C4\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">    <\/span><span style=\"color: #97E1F1\">runs-on<\/span><span style=\"color: #F286C4\">:<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #E7EE98\">ubuntu-latest<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">    <\/span><span style=\"color: #97E1F1\">steps<\/span><span style=\"color: #F286C4\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">      <\/span><span style=\"color: #F286C4\">-<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #97E1F1\">name<\/span><span style=\"color: #F286C4\">:<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #E7EE98\">Checkout code<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">        <\/span><span style=\"color: #97E1F1\">uses<\/span><span style=\"color: #F286C4\">:<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #E7EE98\">actions\/checkout@v2<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">      <\/span><span style=\"color: #F286C4\">-<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #97E1F1\">name<\/span><span style=\"color: #F286C4\">:<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #E7EE98\">Send email<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">        <\/span><span style=\"color: #97E1F1\">uses<\/span><span style=\"color: #F286C4\">:<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #E7EE98\">dawidd6\/action-send-mail@v3<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">        <\/span><span style=\"color: #97E1F1\">with<\/span><span style=\"color: #F286C4\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">          <\/span><span style=\"color: #97E1F1\">server_address<\/span><span style=\"color: #F286C4\">:<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #E7EE98\">smtp.gmail.com<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">          <\/span><span style=\"color: #97E1F1\">server_port<\/span><span style=\"color: #F286C4\">:<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #BF9EEE\">587<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">          <\/span><span style=\"color: #97E1F1\">username<\/span><span style=\"color: #F286C4\">:<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #E7EE98\">${{ secrets.MAIL_USERNAME }}<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">          <\/span><span style=\"color: #97E1F1\">password<\/span><span style=\"color: #F286C4\">:<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #E7EE98\">${{ secrets.MAIL_PASSWORD }}<\/span><span style=\"color: #F6F6F4\"> <\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">          <\/span><span style=\"color: #97E1F1\">subject<\/span><span style=\"color: #F286C4\">:<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #DEE492\">&#39;<\/span><span style=\"color: #E7EE98\">Push tehtud: ${{ github.repository }}<\/span><span style=\"color: #DEE492\">&#39;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">          <\/span><span style=\"color: #97E1F1\">body<\/span><span style=\"color: #F286C4\">:<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #F286C4\">|<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E7EE98\">            Tere!<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #E7EE98\">            Kehtestuse tegi: ${{ github.event.pusher.name }}<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E7EE98\">            Kehtestuse s\u00f5num: ${{ github.event.head_commit.message }}<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #E7EE98\">            Repo: ${{ github.repository }}<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">          <\/span><span style=\"color: #97E1F1\">to<\/span><span style=\"color: #F286C4\">:<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #DEE492\">&#39;<\/span><span style=\"color: #E7EE98\">doe481157@gmail.com<\/span><span style=\"color: #DEE492\">&#39;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">          <\/span><span style=\"color: #97E1F1\">from<\/span><span style=\"color: #F286C4\">:<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #E7EE98\">${{ secrets.MAIL_USERNAME }}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>P\u00e4rast k\u00f5ik, kui me teeme push&#8217;i oma repos, siis github saab meile kiri<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"592\" height=\"428\" src=\"https:\/\/aleksandermilisenko23.thkit.ee\/wp\/wp-content\/uploads\/2025\/09\/F3C01C8D-70AB-49C2-ACEB-05299E3BCA4A.png\" alt=\"\" class=\"wp-image-1883\" srcset=\"https:\/\/aleksandermilisenko23.thkit.ee\/wp\/wp-content\/uploads\/2025\/09\/F3C01C8D-70AB-49C2-ACEB-05299E3BCA4A.png 592w, https:\/\/aleksandermilisenko23.thkit.ee\/wp\/wp-content\/uploads\/2025\/09\/F3C01C8D-70AB-49C2-ACEB-05299E3BCA4A-300x217.png 300w, https:\/\/aleksandermilisenko23.thkit.ee\/wp\/wp-content\/uploads\/2025\/09\/F3C01C8D-70AB-49C2-ACEB-05299E3BCA4A-150x108.png 150w\" sizes=\"auto, (max-width: 592px) 100vw, 592px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Kokkuv\u00f5tte<\/h2>\n\n\n\n<p>V\u00f5ite saata kirju oma postkasti, kui teie repositooriumides toimuvad muudatused.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Final YML Esimeseks me peame looda Github Secrets oma username&#8217;i ja salas\u00f5naga P\u00e4rast seda loome &#8220;.github&#8221; kaust kui seal pole ja &#8220;worklflows&#8221; kaust V\u00f5i loome githubis nuppi abil ( New workflow ) P\u00e4rast k\u00f5ik, me loome yaml faili ja sisestame j\u00e4rgmine P\u00e4rast k\u00f5ik, kui me teeme push&#8217;i oma repos, siis github saab meile kiri Kokkuv\u00f5tte [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1875","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/aleksandermilisenko23.thkit.ee\/wp\/wp-json\/wp\/v2\/pages\/1875","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/aleksandermilisenko23.thkit.ee\/wp\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/aleksandermilisenko23.thkit.ee\/wp\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/aleksandermilisenko23.thkit.ee\/wp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/aleksandermilisenko23.thkit.ee\/wp\/wp-json\/wp\/v2\/comments?post=1875"}],"version-history":[{"count":5,"href":"https:\/\/aleksandermilisenko23.thkit.ee\/wp\/wp-json\/wp\/v2\/pages\/1875\/revisions"}],"predecessor-version":[{"id":1886,"href":"https:\/\/aleksandermilisenko23.thkit.ee\/wp\/wp-json\/wp\/v2\/pages\/1875\/revisions\/1886"}],"wp:attachment":[{"href":"https:\/\/aleksandermilisenko23.thkit.ee\/wp\/wp-json\/wp\/v2\/media?parent=1875"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}