Okay we have covered second John up to verse 11 and we just have a couple of verses left in second John that would be verses 12 and 13 so let's you know just wrap up that so in this final portion John is saying I have much to write to you but I do not want to use paper and ink instead I hope to visit you and talk with you face to face so that our joy may be complete so this is a common way to conclude letters this is how it was done in those days where generally the person who was writing would express the wish that you know that he could have preferred to communicate face to face rather than you know send a letter so a desire is generally expressed at the end of a letter at the end of a friendly informal letter a desire is generally expressed saying I wish I could actually be over there other than just sending this letter to you okay so it's a kind of formality that was followed but over here we see John adding something extra he says I hope to visit you and talk with you face to face so that our joy may be complete now this is a additional wording that he brings in it's not part of your traditional format so he is talking about how if he comes over there then he'll be able to see with his own eyes how they are walking in the truth and you know that would encourage him and also he would be able to interact with them he would maybe be able to strengthen them further in the faith so in in that sense he says our joy would be complete if we could do that and then he concludes by saying the children of your sister who was chosen by God send their greetings so over here he's referring to his own church wherever he is you know based it was usually in Ephesus so he would be one of the Ephesus efficient house churches where he would probably have been based so your sister churches you know saying sending its greetings so these were all sister churches and they would be one person who was who's basically running the place you know so it might have been a lady who is in charge or like I said if they're just using the word sister church in the sense of personalizing the local church so it could be either way so moving very quickly into third John we see that the contrast between second John and third John is that in second John he was warning the church and telling them do not invite preaching travelers into your home because they are bringing false doctrines and over here in third John on the other hand he's making a request and saying please the godly preaching travelers the ones who are teaching the truth when they come to your doorstep to not turn them away you know give them a warm welcome they need that support without your help and support they will not be able to do the ministry work so you need to open your doors to them and welcome them okay so you have the contrast over here in second John is saying you know be very careful whom you're opening your doors to do not welcome them not even greet them because then it'll be like as if you're participating in their wicked work is the word of warning he gives in second John the third John it's in third John is just the opposite because now he's referring to preaching travelers who are actually preaching the truth and he says they need you they're dependent on you so you know it is good for you to welcome them so we see the contrast between these two letters so we will be discussing that in greater detail now I think someone raised a hand if it was me sorry I just wanted to ask that how do we how do we make people understand that put second the second book of John and third letter of John was actually written by John himself there's some circles of Christians that I gave that were written by elders I don't know if you could draw more light on that misconception if it is or if the elder is referring to John himself yeah we very briefly looked at that in the introduction when we spoke about you know just before we started off on first John when we had the introduction we looked at some of the things which make us say that second and third John have been written by John himself talking about the similarity in language and you know I don't really remember now anymore the things which I spoke about in the introduction but that was very very brief if you would like greater detail oh my you know some of the commentaries can get into really great detail I can look through the commentaries that I have with me and then maybe I can post some of those you know in the in the stream page for that the connection kind of went off so yes the authorship of second John and third John so there are commentaries which talk about the grammatical usage they also talk about the expressions you know John's emphasis on love here about walking in the truth so they they pick up on all these things and they say because of these similarities it is John who has written it and they also say that he simply refers to himself as elder because he was so well known in that entire region you know because he was based in emphasis and from there he would travel from place to place you know encouraging the churches and building them up and also because he was because he became very well known he no longer needed to use his name so he would just simply refer to himself as the elder you know rather than saying calling himself the apostle and boasting about his position he kind of was more humble in just simply referring to himself as the elder and that is how he was known and there are these people right I don't remember any more their names but it was there in the introduction you know people like Irene yes and some others who specifically say you know referred to these letters and said John wrote them you know so they kind of make a reference to that so those things were also part of the introduction and I mentioned a little bit of that in the introduction I didn't get it get into too much detail but if you are interested there are commentaries which discuss these things in great detail they will in fact list out all the people who mentioned you know saying that John is the one who wrote that you know from those ancient you know those ancient writings all these early historians and all of that so all those people who actually mentioned saying John is the one who said so and so you know in this letter or that letter so then they use those references to say that there are ancient writers who are backing up the fact that John is the one who authored these things so I had very briefly touched upon that in the intro session that we had so you could maybe refer to that but for more details I could you know put up a couple of commentaries which have good introductions for this for this particular aspect I can put that in the stream page and you can just check it out so maybe by evening I should be able to put that in the stream page yes so we've stepped into the John now and yeah so it's written to a person named Gaius I have no idea how to pronounce his name so that's just my pronunciation so this letter does not have much theological content or anything it's mainly you know three things that are being said first John praises him for the for the for the love that he has shown for the hospitality that he has shown to the traveling preachers to the missionaries who are coming to his doorstep then second he talks about somebody named Diotrives who is not showing hospitality and in fact is being very very hostile towards the missionaries you know the true missionaries who are coming and third there's a he kind of recommends somebody named Demetrius so it's basically these three things that happen in this very brief letter so again just like in the previous letter we see that he begins by saying to my dear friend guys whom I love in the truth okay so the emphasis is always on them being in the truth as against the fake teachers and the fake believers you know you would not call them believers the fake Christians who consider themselves as being in the truth but are actually not in the truth so there's some debate on who this Gaius is because there are two Gaises mentioned in our New Testament the first one would be the person mentioned in Acts 1929 and Acts 24 in these two places there's this person named Gaius who's from a place called Derby that would be in the region of Galatia okay so that person who's from the region of Galatia from a particular city called Derby he was a traveling companion of Paul so when Paul would go on his missionary journeys this person would also accompany him so is John writing to that Gaius maybe maybe not we do not know there's another Gaius also mentioned in the New Testament that would be the person mentioned in 1st Corinthians chapter 1 verse 14 and also Romans 16 23 now this Gaius does not belong to the region of Galatia rather he lives in Corinth and this person Paul says he's one of the few people whom I personally baptized okay so this Gaius also he stays in in in this Gaius house on one occasion so Gaius is his host in Corinth when he's staying over there so so which Gaius is being addressed over here we do not know it could be somebody else altogether I mean after all Gaius was a common name in those days so it could be one of these two Gaiuses or it could be somebody else that is being referred to in this letter the details of course are not given to us we don't get the impression that this man is the head of the house church or anything but it's probably his house in which the church is meeting because he's the one who is being you know who's being opening his doors and offering the hospitality to the missionaries who are coming so he probably is the one who owns that house and the church runs in his you know in his premises coming to the verses verse two which of course would be a general greeting I someone could read out that verse two go ahead I pray that all may go well with you and that you may be in good health as it goes well with your soul yes so again this is a general form of greeting that was you know used in the letters of that time it was considered polite to you know make a reference to the person's health and wish them good health so he does that but again over here but I even as he's doing that he adds something extra to it so he says I pray that you may enjoy good health and that all may go well with you and then he adds this extra phrase where he says even as your soul is getting along well so he's referring to the fact that Gaius is doing very very well in his internal I know condition in the in the way he is living his life in the way he is following the truth you know in the way he is expressing the love of Christ towards the people who are coming to his door so in all of those things his soul is doing very very well whenever John mainly uses this particular word the Greek word would be suke so wherever John generally uses the word suke he usually is just talking about you know the normal natural human life to use an example if we could actually go there and read that John chapter 10 verse 11 if someone could read out John chapter 10 verse 11 okay so the good shepherd shepherd lays down his suke for the sheep it just basically means you know your life you lay down your life so usually whenever John uses this word suke that's all he's talking about he's just talking about the natural life but on a few occasions John uses this word suke in a in a to talk about the inside the internal soul one example of that would be John 12 27 so if you could please read out John 12 27 could someone please yeah now it's so troubled and what should I say father save me from this hour okay so purpose I have come to this hour yeah so here Jesus says now my suke is troubled okay so over here it's obviously not talking about just the natural life it's talking about the internal emotions the will and the emotions and the mind so over here Gaius is you know over here John is referring to the internal soul and so he says your soul is doing well the way you are living your life is good and so in the same way may your health your external health also may that also go well is what he is saying and then he goes on to explain what does he mean by your soul is doing well how is his soul doing well that gets explained in verse three if someone could read out verses three and four I rejoice greatly when the brothers come came and testified your truth as indeed you're walking in the truth I have no greater joy than to hear that my children I walked on the truth yes so it's he says it gave me great joy when some believers came and testified about your faithfulness to the truth so in what sense is his Gaius soul doing very very well he is being faithful to the truth and so he is and also it says over here yeah he says it gives me great joy to hear that my children are walking in the truth so this man is not only holding on to the correct doctrine he is also continuing continuing in the correct action so his his doctrine is correct and his actions also are correct how are his actions correct he is willing to open his doors to complete strangers whom he has never met before but he's willing to do that for them because they're coming in the name of the Lord and they are doing you know the Lord's ministry so even though he does not even know them he is willing to open his doors to them and so in verse five he says John says dear friend you are faithful in what you are doing for the brothers and sisters even though they are strangers to you okay so now you know he goes on next to talk about you know diotreeves who is not showing hospitality so it's likely that maybe the people they probably went to diotreeves first because he seems to have some kind of leadership position in the church but diotreeves was refusing to offer them hospitality so it's likely that you know when they're if when they were when they were turned away by diotreeves maybe they came over here to Gaius doorstep and Gaius was willing to take them in and so he says yeah even though they are strangers to you you are willing to take them in you were not like this diotreeves who refused to take in the the the missionaries into his home if someone could read out verse six please who testified to your love before the church you will do well to send them on their journey in a manner worthy of God okay so the these people who have been helped by Gaius when they finally went back home they told their house church about how they had been treated by Gaius and I mean when John heard about this he was very very happy and so so what would happen is that when you have these traveling preachers going from location to location when they would go back home they would obviously carry information with them about how they were treated in different places so they would obviously tell that you know in so and so place that church you know opened its doors it welcomed us it showed us the love of Christ so they would share that information and so it would create a good impression regarding that church and also the church back home would would feel that okay these other churches are standing with them they care about them and you know it kind of builds up that sense of community so you see when we look at the previous letter what if the church had opened its doors to the wrong kind of people again you know it would create that sense of you know either you're showing showing a sense of unity with those people or you're showing a making a clear declaration and saying we are not part of this so it's all very very interlinked these early communities they were so linked to one another how you would treat their people how you would treat their preachers would send out a declaration to everyone else who's watching so you're either making a statement yes we are one with you we believe in what you believe in or you're very clearly declaring and saying no we are not part of this you are different we are different you know so stay away because you carry the wrong doctrine so there's a very clear message being sent here the the the church has gone i mean these missionaries have gone back and made a report only thing of course in this case it's a it's a good report and john is happy that he's you know that that gaius has received these people with love and he gives a word of advice and says please send them on their way in a manner that honors god now we're not very sure what this means he could be saying provide them with the finances that they would need you know to for their return journey because in those days traveling cost money i mean you know they didn't have very easy inexpensive forms of transport so they would have to make arrangements for their travel they would have to stay in different places as they are you know returning back so they would need to have money in their hand for all of that so maybe he means when you're sending them away you know send them with enough for them to be able to go on to their next location comfortably or it could also mean when they are going please write out a nice you know letter of recommendation for them so that when they go to the next place to the next church that church will will see your letter of recommendation and be willing to receive them in and why do you need to do all of these things because in verse seven and eight it says it was for the sake of the name that they went out receiving no help from the pagans we ought therefore to show hospitality to such people so that we may work together for the truth so if they go to the doorstep of some person who is not a christian that person will not even care about them and if they go to a public inn or a public lodging place that's very it's very dangerous they may get robbed they may get killed so nobody is going to come to their help but they are doing it for the name for the sake of the name for Jesus Christ and so we who are part of the faith he says we should show hospitality to them even though they are strangers to us we must be willing to take them into our homes and when we do that we are actually working together for the truth he says you know among the giftings if you remember among the you know giftings which are listed hospitality is one of the giftings which are you know mentioned and people you know have a lot of praise for apostles and teachers and prophets but nobody you know speaks much praise for those involved in the hospitality gifting but imagine I mean if those people would were not showing the hospitality that they were showing the great commission would not even have been accomplished because these people who were trying to fulfill the great commission going from town to town they were depending on the people with hospitality gifting so the people who have other giftings you know other than the main popular ones they also are contributing just as much to the great commission so that's something that we must actually recognize and value instead of you know reserving our praise and our regard for only those handful who walk up in the front and do something which can be seen by everyone maybe we should also realize how much is being contributed by the people with other giftings who are also doing their part in making the great commission happen so the person who is you know involved in hospitality is will be rewarded just as greatly as the person who's maybe being a postal and planting churches so in God's eyes these people are also working together for the truth just as much as the you know the missionaries who are actually going around planting the churches so we see these truths coming across another thing just to know to talk about how they were not receiving any help from pagans like I said if a stranger goes to a new place the local law over there you know the local law agency over there is not going to give him any kind of protection so in case there is anything you know in any issues involved the people who have taken that person into their home they are the ones who will speak up for that person they will you know may see to it that legal redress is you know offered so they are the ones who would speak up for that person because the stranger on his own has no legal rights you know in another you know in another foreign town because I mean he's not a local from there it sounds very strange because today I mean it doesn't matter whether I'm staying over here in my house in Bangalore or whether I go and book myself in a hotel in Mumbai even in Mumbai I would be treated as a citizen I would have all my legal rights I can go to the nearest police station if something happens and I will be heard you know my FIR will be filed all of that but back then these towns and cities would function like independent units I mean unless you're a really important personality and with an official you know designation nobody would take you seriously the local law bodies would not even you know care if you have lost all your you know possessions and you're in a bad situation so that is why he says over here the pagans will definitely not help them we are the ones who have to open up our doors to these missionaries who are trying to you know fulfill the Great Commission by visiting place I'm going from place to place you know sharing the word of God and so after having said these things he comes to verse 9 where he is talking about this person named Diotrives if someone could read out verse 9 please I have written something to the church a diatrophist who likes to put himself first does not acknowledge our authority yeah he says over here that he has actually written to the church which probably means you know it's the same house church which Gaius also attempts he says I have written but this person Diotrives who loves to be first will not welcome us so we see that Diotrives over here is opposing the missionaries and not allowing them to you know come and stay in their homes because he is a person who loves to be first so we don't really know why he is actually so against opening his doors to the missionaries is it because he has gone into Gnosticism and now he's kind of opposed to the church it could be that but then it looks like he's still very much part of this community so maybe it's not really the Gnosticism maybe the reason why he is not willing to take in new people is because he loves to be first you see that seems to be a more likely reason he doesn't want competition he feels threatened when you have traveling missionaries coming in and sharing the word and you know maybe they have excellent speaking skills and they are ministering in power and people are admired what they are doing and they praise them and Diotrives does not like that he wants to be first he wants to be the one person on the pedestal who's always admired and looked up to and he doesn't want any kind of competition so it looks like that's the reason why he is not encouraging anyone else to come it's like as if he is saying I'm the only one who knows the correct truth I'm the only one who can tell you the correct things so you have to listen to me you know don't listen to others and he's kind of shutting out ministry work because of his desire to be first so we see a very dangerous attitude here in Diotrives and we see that you know in in a lot of people even in our you know modern church so it is something that we need to watch out for it is a church must be careful with the kind of people that they invite you know to their church to stand at the pulpit and preach so yes we must be careful to see that the right doctrine is shared but at the same time a church should always be open for other ministers of God to come and you know to be able to impart to be able to you know pray over people so these are things that no church should be so closed that it doesn't allow other people to impart because we are one body of Christ so we are all supposed to be partners in the ministry and sometimes God will send us people from other places you know to minister into our lives so yes as a church we are very careful whom we place on the stage and whom we allow you know to minister into our lives but at the same time we are we must always be careful that we are open to what God is bringing us through other people we must not be exclusivist where we say that we are the only correct church we have the only right teaching we refuse to allow anyone else inside you know we refuse to accept and be part of the larger body of Christ so that kind of an attitude is wrong diotrives seems to be seems to have exercised that kind of an attitude so John is saying I wrote to the church you know he the missionaries that he sent out he sent them out with a letter of recommendation saying you know please you know give them shelter they have from they are from us they are good people they have the correct doctrine so please open your doors to them you know and give them shelter so it's actually written to the church a letter of recommendation and sent it for these people but these people have not been welcomed and then he goes on to give more details about the way diotrives has been treating them if we could read out verse 10 if someone could read out please verse 10 so if I come I'll bring up what he is doing talking with kid nonsense I'm not content with that he refuses to welcome the brothers and also stops those who wants to put them out of the church okay so this person is speaking in a malicious wrong manner about John and the missionaries that he is sending out he's speaking against them he himself refuses to welcome the believers he refuses to open his own doors you know to them but he's going one step further and he's even telling the other members of the church not to open their doors to the to these missionaries in fact he is taking action against them so if someone is welcoming someone into their home and you know putting them up he is in fact having them excommunicated from the church which means that this man had some level of influence in that congregation otherwise he could not have gotten away with it right so he's somebody that the people looked up to somebody that the people respected and so he in fact had the authority to have someone excommunicated if they choose to you know entertain missionaries that he is not approving of and that's a rather you know aggressive way to use his leadership position because if you notice in the previous letter second John even though John says to the believers you know do not open your doors to false teachers he never ever says if you do that I will excommunicate you I'll have you thrown out of the church even John with the authority that he holds never does that never says those things but look at Diotrius over here he is using his you know authority in the church to go to the extent of dictating what they should do and he's having them thrown out of the church if they refuse to comply with whatever he is saying so it looks like this man is in a position of power but he is abusing his authority and so John says when I come I'll deal with this someone needs to publicly speak up and rebuke this man and make it very clear to the entire congregation that what he is doing is wrong because if he is left alone he'll continue doing what he is doing and the congregation will actually think oh okay maybe this is okay you know maybe maybe what Diotrius is saying is correct and maybe we should become an exclusivist house church which refuses to open our doors to anyone else and you know who doesn't know you know and we'll not participate in the great commission not partner with other people help them assist them you know so they would get the wrong impression about the whole missionary endeavor and so he says John says when I come I will deal with this I will call attention to what he is doing because someone has to rebuke him publicly and it should be made very very clear that this kind of an attitude you know is not to be tolerated and like we know these letters were always distributed you know they would after it would be read out in this particular church it would be sent to another church and the other church would also get to read it and then it would be passed on to the other congregations so everyone would get to know the correct way to behave with with traveling missionaries and the wrong way to approach the whole thing so these matters this very practical matters would be made very clear through these letters which John is sending out okay so so so we get to know that the attitude that diotrix has adopted over here is clearly the wrong one you are not supposed to use your leadership position to throw people out of the church just because they are not complying with your wishes there are you know there are valid factors mentioned you know in other parts of the New Testament where yes you would have to excommunicate a believer and you know send them out at least temporarily until they have been disciplined and corrected but this this is just you know a minor issue especially because these people who are coming to the doorstep are true missionaries who so diotrix never says that they have wrong doctrine all he seems to be saying is no we should keep them out because he wants to be first so it's a very very wrong attitude and so John you know speaks up against it now we come to the very last portion which is you know versus 11 and 12 where he is now making a request so there seems to be this person Demetrius and it looks like as if you know he's saying Demetrius is coming now with this letter to you please open your door to him don't be like diotrix but rather open your door to him and allow him to stay over here because he's a good person so it's like a letter of recommendation that is now being I know given to Gaius if someone could read out versus 11 and 12. Beloved, follow not that which is evil but that which is good he that does good is of God but he that does evil had not seen God Demetrius had good report of all men and of the truth itself yeah and we also bear record and you know that our record is true okay so um in verse 11 John says anyone who does what is evil has not seen God so you know he's saying this diotrix who is doing evil who is working against the gospel it looks like as if he's a person who has not seen God it's like as if he has not really caught the truths which which Jesus has been teaching so do not be like that rather do what is good and what is the one good thing which you can do immediately right now it's regarding Demetrius Demetrius is someone who has spoken of well by everyone everyone says everyone acknowledges that this is a man who has been walking in the truth the truth itself acknowledges that he is you know that he is good in the sense he is somebody who has been following the truth and practicing it so therefore I know you he is someone that you can trust so it seems to be he seems to be indicating that Demetrius is the one who is going to be coming holding this letter in his hand and when Gaius reads this he should welcome Demetrius into his home he should not be like diotrius who is opposing the believers and when um John comes along he will take action against diotrius so that's the basic essence that we get from these verses um so we come finally to the last portion and if if someone could just read out verses 13 and 14 yeah I had much to write to you but I would rather not write with pen and ink I hope to see you soon and we will talk face to face please be to you the friends greet you greet the friends age by name okay so um we have the usual you know closing remarks being made but then again there's something additional added over here and this is what John says the friends here send their greetings so the term that he uses is the friends over here are sending their greetings and then he says greet the friends there by name so this is not a very common term that is generally used but maybe these believers at the early church were calling themselves the friends in the sense you know Jesus had said right that you are no longer slaves now I regard you as friends and so here we have you know John using that phrase and so maybe maybe in the early church you know the believers used to refer to themselves as the friends you know the friends of God the ones who had been specially chosen by the Lord to be his friends so he says the friends over here are sending their greetings and so you know greet the friends who are there in that church so he ends on that note yeah well whatever we could draw out of these letters I have tried to convey that so some of it has been a bit repetitive I know I'm very sorry for that but I hope that you know the main points have come across so we are kind of done anyone has any questions otherwise we can just close with a word of prayer can I ask yes go ahead yeah you were teaching in the first session you were teaching about gnostics so keeping that in mind in today's current world like could you help us recognize like are there any like Jehovah Witness or can we call them doing the same thing or are there any other significant preachers or people or some groups that are following wrong doctrines like could you just help us know a few in the current scenario I yeah I mean I only know the familiar ones that you know are there in our in our you know Indian setup there may be others in other regions if you were to go to the internet and if you were to type wrong cults or something like that you would get an entire list of all kinds of wrong cults which are out there currently so that would be a very detailed list but then yeah the ones that we encounter in our own circles are of course the Jehovah Witnesses simply because they tend to come to our door step you know with their teachings so we have encounters with them and yeah they are their belief of course is that you know Jehovah is God but Jesus on the other hand is a created being and he is not divine so yeah we come across Jehovah Witnesses we have the you know seventh day Adventists who would prefer to have their church service on Saturdays most of the teachings are quite all right but there are some one or two things which they say which don't quite gel with scripture we have I mean I know a lot of Orthodox you know churches which they call themselves Orthodox but then they have a they worship ancestors and things like that I don't really want to name any churches you know because I mean we have students who come from all backgrounds and they're all you know doing their best to find out the truth and learn from the scriptures so you know I don't want to just simply name any church and then you know brand them as all pagans because even in those churches there are so many who are you know trying to find out the truth by going to the scriptures attending courses you know learning online and so I do want to pick any names it's all right yeah so the the main thing is that we can't help the church that we are born into we can't help it if we're not entire family attends a particular church we are part of it because we are part of that social setup but then we as individuals because we have a hunger for God we love him you know we we do our best to dig into the scriptures and find out for ourselves what is the truth and so we everything that our our you know our local churches our the churches to which we are affiliated even though they may not follow all the correct teachings we try from our side you know to follow the truth and maybe share that with other congregation members so that they too will know the correct you know doctrine and not be led away so yeah it's difficult to just simply say you know oh this denomination because I know some people who are in that denomination who are following the truth and I cannot just you know lump them with the others who are not following the truth yeah so we'll just leave it at that yes all right yeah um anything else that anyone wants to you know bring up we have two minutes otherwise we can close with the word of prayer yeah let's just close with the word of prayer Lord we just thank you so much for all the things that we could you know cover in second John and third John and in fact Lord the Gospel of John as well thank you for being with us even as we went through this entire course thank you for all the lessons that we could learn oh Lord please help us to apply these things in our own lives and help us a lot to grow Lord even as these two letters touched upon wrong doctrines right doctrines Lord I pray that you would help us to be sensitive to your leading I pray that we will always be students of your word who really take your word seriously study it look into it when we are taught things from the pulpit we would be like the Barians who went back to the scriptures to see whether whether whether what was being taught from the pulpit was actually in line with scripture or not help us to be serious students of the word of Lord so that we will not be led astray by false teachers but that Lord we will be able to hold on to the truth and be able to walk in it and therefore have God because those who have the truth have the father and the son and those who are led away they do not even have the Lord and that would be such a dangerous state for us to be in Lord so I pray that you would help us to always remain serious discipline students of the word who will hold on to the truth and test everything that is taught so that we will know whether it lines up with your word or not thank you Lord in Jesus name amen thank you so much so you know those of you are still working on the assessments please you know finish it by 25th because that would be the last date thank you thank you ma'am thank you


Heroin 1 was found to be non-inferior to the comparator at 13 weeks post-injection in European patients with mild to moderate neostearthritis. This suggests that Heroin 1 may provide effective relief of pain associated with this condition. This article was authored by Tomasz Blotarski, Piotr Lukasek, Rafa Plibanski, and others.


Welcome back to the channel. If you've seen this video of mine about submitting contact form 7 forms and data to an external API or email, you should have probably been able to do a couple of things. But I got a couple of people asking me questions about what happens if I have a dropdown or a file uploaded and that's what I want to experiment with today to share with you. I just want to do something like this where we're going to send this same data to an external API or even to email. If you're interested in this, then let's dive into the code. So in my edit, I'm going to go into the WP content. I'll open up a new plugin in here that I'm going to call CF7 trap API. And I'll copy this and I'm going to make a new file inside here that's going to be a PHP file. And after doing that, I'll open up PHP right here and then I'm going to add the comments for my plugin to start by using a snippet that I have in my editor. So I'll say this is a contact form 7 form trap. Just need to correct this right here. And then I'll change the plugin link to my github where I'm going to save all of this github.com slash and you can be able to find this particular code on this github link that we have here so that you can be able to check out the code and see if there's anything that we left out or you feel like you need to just check out the code and use it as you want. This will be in the video description in any case that you can pick it up. So right here, I'm going to change this to take your price. Get contact form 7 data and send to API. So I'll just change this. I'll give this a JPA license so that you can pick it up without any trouble. And then I'll just add a text domain which I'm going to use as my plugin right up here.  And what we want to fulfill here is that we want to check if the app's path has been used, which is basically a WordPress constant that is used when these particular plugins are run. And if that's not positive in terms of check, I'm going to say unauthorized access and that will stop the code from running and the hacker will be left standing without thinking of anything. So the first thing that I will do here is I'm going to add an action and inside here it requires about four things but one it requires the hook ID or the name of the hook. Then you have a function here that you're going to run. I prefer not to do anonymous functions. So I'll say take a press contact form seven data and after this you can have things like priorities and then you can also have the number of arguments you're passing in maybe the two or three or it's just one. So for now I'm just going to leave this here and I'll add the semicolon right here. So the hook that we are going to use is wpcf7 mail sent and this one is going to check for whether the mail has been sent and then it will pass the data in here into this function. So let's write this function. I'll add it there. I'll add the name to it and I'll add these brackets right here and the one thing that we get from this hook is actually we get the contact form. So I can check the contact underscore form. That's what I'll have here and then I'm going to use this to check for the forms title to see if I'm actually running the right form. This should not be happening on every form. It should be happening on the right form and then we can do the rest of the code right here. So let me go back to my wordpress install and I'm going to set up my form. We'll be able to see what data is coming in from here and save it right here. So if you don't want to see me set up the form you can skip that particular section by checking in the description you will see that there are video chapters. So you can go to the next part that says we are coding and we have skipped the whole process of making up the form. So otherwise if you want to see me create the form let's continue the video. So I've activated my contact form seven here and I'm going to create a new form and in here I'm going to call it web API and inside here I'm just going to delete all these fields that we have here and I'm going to start afresh so we want to have a text which is going to be required and it will be a name so we can have a placeholder right here we'll not have a default value no classes I'm not going to style it after adding our text we want to have an email I'll make that also required we'll have a placeholder right there and then we're going to have a drop-down menu which I'll say is also required and we're going to add options right here line by line so I'll say someone has to choose maybe a particular type of food so we have spaghetti we have onion rings we are going to have rice and then we shall say someone can probably get stew so we won't allow multiple selections we'll just say let's allow only one item so I'll insert that tag as well and then we're also going to upload a picture for them to tell us who they are so I'm going to add a file right here I'll say this is required the file size can be those many number of zeros I'll add a PNG I'll add JPG I will add GIFS I'll add also BMP for bitmaps I'll click to insert this and those are the files that are accepted and then we'll finally add our submit button here which I'll say send and I'll click the insert tag here so after setting this up I'm going to go into the mail section of course this is telling us that it will require us to add all this information we'll send it to this email it will be from this link the subject can be anything but I can just say web API data that will be the subject I'm just going to copy this email and I'll paste it down here as the email to reply to so in here we need to pass the arguments that we have in this form but we cannot quickly see them from this section so I'm just going to save this for now so that we can be able to pick these items easily so I'll copy this and then I'll paste them right here so in the message body that's the information we want to get here the name shall say email we shall talk about the food that is chosen and then we shall say maybe picture so that will be sent to us and we're almost good to go so everything else is okay I can leave it as default I'll hit save here and you'll see that our form is confirmed it's all good I'll copy this and I'll put it on a page so I'll create a new page right here CF7 form and then I'll look for the short code block right here and then I'll paste in this form I'll click publish right here so we're going to be looking for the web API form right here when we save it I'll go ahead and look at this so that we can see it now it's a little bit hard to know what's going on here because I set up my form poorly let me just go back a step and just save a couple of things to make sure that we are doing a very nice form so I'll edit this I'll just add a label so I'll say label I'll say 4 and then I'll send name right here and then at the end I'll close off this label this label is going to be for this particular field so I'll copy this and put it here and then we are just going to basically do the same thing I'll copy this paste it here and this will be for this email and then I'll do the same for the select so just I choose your food choose your food and then here it's supposed to be email and then the food will be for menu 30 and then I'll just copy this finally and say send us your picture send us your picture and I'll hit save right here we shall open up our form again at least now we can see something the name will be take a press the email will be drawn at dough.com we shall choose to have rice we can browse for a picture from our computer I'll just add this picture right here and then I'm going to click send and you can see that our form works really well so let's go and trap to see what information we get from each particular form so I'm going to go back to my code and in my editor here I'm going to check and say if and here the condition we have to meet is if the contact form that we have here we're going to look for the title on this and we're going to say if the title we get is actually equal to web API web API because that's what we set up for the title of our particular form that we're using I'll just add some space here so that you can see this clearly if we are getting information from this form so in here I'll set up a variable that's going to be for the submission and in the submission we're going to use the WP CF7 class that's what we're going to be looking for and we're going to add underscore submission so this particular class has a method which is called get instance and this method is actually a static method so that's why we're adding these two full columns right here so we're going to get the instance of this WP submission class now if you're not well versed with what object-oriented programming is or which is normally called OOP object-oriented programming has classes and in the classes there are functions which we usually call methods so this method is what's being called so whenever we trigger a form and we send data this class will be called and this instance will be got so from that submission I want to get something from it I want to get a particular method which is actually called getPostedData and we want to get that method chained in here and what I'm going to do is I'm going to say this is our data and I'm going to store it in a variable so we're declaring this and then we're adding one method to get this data and we're saving it as data here now in order to see what's coming in I'm going to use error log underscore log which is a PHP function and it's going to allow us to log our data in this debug file that you see here under wp content and that can only work if you've turned on the wp debug log and you make sure that it's defined as true inside your wpconfig.php so make sure you have this line in this file and then you'll be able to debug and log all your information here so this is what I use to help me to see what information I'm getting so I'll add a printR function as well that's going to get this data that we have here and then we're going to add a comma and add the word true because this printR actually is going to convert our text into a string that error log will finally accept so I'm going to go back to my browser and in my browser right here I'm going to add a new name and say John I'll say John John at John.com John at get.com and then John is going to hit onion rings we shall add a new picture that's going to be this image right here and then I'm going to hit send and after sending this I want to go and check my error log so I'll go back to my editor here I'll look at the debug that we have here and we'll see that my debug is empty so I need to check what the problem is and it's most likely something to do with the check that we have here so I'll go back to my editor I'll look at the form and you'll see that the form here title is actually in lower case right here so let me go and correct this I'll change this right here and say that's our title save it and just to be sure I'm going to go back and check in the admin section and I'll make sure that my plugin is actually activated I'll activate my plugin and then I'm going to come here I'll reload this page let's try to send some data and say me me at me.com I'll choose spaghetti I'm going to add this image I'll hit send so let's go back into our editor I'll look inside our debug log we have this data in this form now fortunately this is a text this is an email this is an array of data so we get what was chosen and then we get this file that has this encoded string now this string comes from contact seven and it's just a coded because what happens is that contact form seven never stores any data on that on the server for you all it does is that it gets that information attaches it to an email and sends it out so once it's sent out that attachment it will always destroy it or it will always erase it from its code what do I mean by that if we go back to our code here I'm going to introduce something that's a little bit different in this particular class there's something called uploaded files and this uploaded files is going to give us whatever file we upload so I've changed our data here we're going to see the uploaded files when we error log them so I'm going to save this I'll come back to my front end here I'm going to just do another ping and say me at memem.com we'll choose to have rice onion rings and I'll add a new screenshot that I have and I'm going to send it and once I do that you check that our debug log is actually going to have quite a number of things ignore my errors that I'm having here you will see that this array that we have now actually has a file path here and it takes us to WPC 7 uploads and we see that this is happening here and we have the name of this particular file and if I come here in this plugin itself if I go into my uploads here and then I look at this you will see that we don't have that file there or if we look in our uploads in 2021 07 you will see that those particular files actually don't exist in our uploads now that sort of puts us off because we can't get the file we can't do anything but I have a little trick that you can use there is a plugin addon that you can actually use and it stores this data when you send it and that plugin is actually something that we can come in our plugin section go to add new we shall look for contact form 7 and we're going to install this contact form 7 database addon and what this plugin does is that it creates a database table inside our database so I'm going to open up my database tools and you're going to see that database table and right now you will see that we don't have any WPC 7 database table in here but once I come to my plugins here and activate this on activation you're actually going to come back to our database tools and you'll see that we have a new table here called wpdb7 forms and right now we don't have anything here but if I come and then add a name I'll add my email and then I'm going to do maybe rice or stew I'll choose to have this image coming in here and then I'll click send this particular tool is going to allow us in here to see that we have forms and when I click on that form you'll be able to see the email that I sent you'll see the name that I used you'll see the stew you will see that debt this was sent and you'll see a file that actually is attached to this now this file is actually downloadable because it has been stored inside our database and if I go back to my editor and just look inside uploads I go to cfdb7 uploads you'll see that we have this file in here it's local and part of our site so with this we can actually be able to send that information to our API so instead of tapping contact form 7 we are going to tap this particular plugin when it has saved this data we can actually pick this data and send it to our own API because that data will be saved so I'm going to just look inside the code of this plugin and we'll see whether we have some action hooks that we can actually pick so here we have the function that creates the table we have the function on activate which basically creates our table we have the function that upgrades our table and then we have a function to deactivate and if I scroll you'll see this function that says before send email and you'll see that we have our files here uploaded we store a variable in here and it's the link to the upload folder and once we actually submit our form we get all that information coming in we save a few filters and then in here we actually make a copy of that file and then save it inside our upload folder and that's what this plugin is actually doing so if I scroll down you'll actually see that we have a do action here called CFDB7 before save and it comes with the form data that is actually available for us to use so I'm going to use this do action I'll copy this right here and it's what I'm going to use to get my data and send it to the API so we're going to have a couple of changes coming in here and then I'm going to change the action hook to this I know we shall be getting our data from here so I'll get from data and I'm going to change it to this location here I'm going to just comment everything out here and then I'm just going to error log our form data when we get it so I'll copy this and then I'll test it right here so we are now basing all our code on the new extension plugin that we've added so I'll close this up I'm going to clean out my debug so that we have a clean start and then I'm going to go and send some new files so this time I'll say the police is sending police at police.com I'll change this to stew I'll add a new file with this click open I'll send this our form is cleared once we come to the database here and select the data you will see that in the first instance we had this form that was sent we now have another form that has been sent with our police data that is actually serialized right here so I'm going to go back to my forms as well and just look at the contact forms and you will see that we have this data showing up here and if I go to my editor you'll actually see that we have our data here we have this string of data that actually goes inside our uploads so I'll go to uploads I'll go to CFDB 7 and you will see that we have a similar file with the name L logo with gold and this is what we have here so this makes it very easy for us to actually manipulate and send to our API so I'll just get the link or the URL that takes us to this file folder and then I'm going to patch it and add on this extra string coming from this particular file so this is what we're going to use so I'm going to copy this I'll reduce this down here and I'm going to paste everything that we have here so that we can quickly follow through and be able to make our changes and then number two I'm going to just go back to this form I'm going to pick this code that they use to make this variable which is basically the upload directory and get this I'm going to come back here and I'll say this is I'll paste this and I'll say the upload directory is actually just going to be what we have here so we have this CFDB name and that is brilliant so we'll just get what we have here and we're going to attach it to this and we shall be able to get the link of our files so all I need to do is just get what we have here and then paste it here now in order to get our data here we're just going to say we'll get the form data and I'm going to pass this in as an array so we'll have an array here and inside this array I'll say we're going to have our name so name is here I'll chain it to our form data and then I'm going to pass in this value so I'll just copy this put it here and then enclose it in quotes add the semicolon I'll duplicate this we just need to get this we need to get the email as well copy this paste email here this semicolon won't work in our array we just need to pass a comma and then I'll make this as email and then I'll duplicate this to get our menu so copy this change it here and then we'll get our food and the only difference is that this array comes only with one option so we need to get this bracket and the zero as well to give us our food we don't want to get the array we want to get this final string that comes from the first entry in our array and then finally I'm going to get the upload and this upload is basically going to be what we have here so I'll copy this paste it here and we're going to say from the form we want to get this file so I'll copy this and then I'll paste it here and remove this zero because initially it wasn't part of this particular array item so I'm going to just remove the rest of this code because we don't need it and we have our data here properly which is a good step the next thing that I'm going to do is use the wp remote post so I'll add a semicolon here and I'm going to describe my URL which needs to be enclosed in strings and then I need to also describe what my arguments are and this is usually an array so in this array we can actually pass a couple of things one is we can find passing the method that we're going to use whether we're using a get, a push, a post, an update and in this case we're going to be sending data so we need to use a post the other thing that we need to do is pass in the body and here the body that we shall pass is actually going to be our data here so I can copy this and pass it in here as the option and then we need to get our URL we are going to send this data now what I do usually I use an automation tool and this tool is actually on intergrammat intergrammat is an automation tool that allows you to sort out like your API needs and so much more so you can actually go here and sign up you can use the link that I've left in the description so that I can get a tip of your purchase if you ever purchase from it and that doesn't mean that you will get any extra charge on you so that's one way of supporting the channel so I'll click sign in here and once I log into my account here I'm going to create a new scenario here and the scenario that I want to create is I want to get a webhook now I'll choose this webhook and I'm going to choose one that triggers off an action when it receives the data so the first thing that we need to do here is add a name to our webhook and I'll click add and I'm going to say this is our CFDB I'll say this is our CF7DB data I will not place any IP restriction because we want this to be general but if you want this to be private you can always add an IP and I will hit save after adding this webhook name I'll hit save and you'll see that Integroma tells us that it's now listening for the data to determine what kind of data is going to be coming so I'll need to just copy what we have here so I'll copy that address and then I'm going to come to my editor here and I'll put that address inside my code and I'll save this and what I'm going to do now is just come back here I'll make a new post and say this is someone who is probably an employee somewhere they're ordering for stew they are putting their picture here and then they are hitting send so once that is done and you will see that Integroma tells us that the data has been successfully determined and we can now click OK right here and you will see that it refreshes the data I'm going to add a new module here which will be a JSON module I just want to see my data in JSON format and I will choose to aggregate that data in JSON now I create a link among these two modules and you will see that this quickly picks this as the source module so it's basically picking the data from it and now we need to add a data structure here and I will say my data structure will be CF7 DA data structure I will now click add item here and you're going to see that we expected to have a name which would be a text I will say this is required I'll add that I'll add another item which was our email and that needs to be a text as well I'll add it as required I'm now going to add our food the food is also a text required I'll add that and then we're also going to have an upload or a file I'll say this is image and this image is also going to be a text because it's a long string so I'll choose a text and I'll say that's required as well and add so once we do that I'll hit save here and you will see that this creates a new open dialogue box so that we can actually pick information from our webhook so here I can pass in the name here I can pass in the email here I can pass in the food and right here I can pass in our upload so I'll click OK here and you will actually see that this is going to work out so I'm going to click this to run and now that this is running let's go back here and do some more changes so I'll say John at doh.com that should be an email so I'll cut this and put it in the email I'll say this is John Doe I'll say John Doe likes Stu and John Doe is going to send an image from here and then we'll click send and once we do that our intergrammate here has run that operation you will see that we received all this data showing up here we need to make the correct link for this URL but we can also click this and now you will see that we have our data in here and everything is working as it should actually look so this is how you send data to an API you can be able to do so many things from this point you can use intergrammate to send to emails to send to various servers to do different things and that's how automation tools actually help you but you can see that that's how we can send data from our web form and actually send it out so the only thing that I need to do is change what we have here so I'm going to change this to the home URL and inside our home URL I'm going to pass a couple of things in here so what I'll say is when we come to our home URL let's go to the wp content we'll do a slash and we're going to go inside our uploads and then inside the uploads we're going to go to this particular file so I'll change this right here and then we'll have a slash here so we know that we're going to the right URL I'm going to remove this because we don't need it anymore and we shall use our upload directory actually right here so we shall be getting this and we're going to chain on the name of this file so I'll save this let's actually go and test this out and see that it works so I'll come back here I'll say let's have Kylie going to send onion rings and then we're going to upload a new file which is this I'll click open I'll hit send here I'll process the existing push that we made to our server because that was recorded and when I click here we have the correct string for our data here and we can also see that that's happening right here in our JSON string and if I actually go to this link and open it in the new tab you can actually see that we have our link it's downloadable it's can be usable in any place so our contact form 7 database addon actually does it really well for us and that's how you can actually get your file upload that's how you can get your information working from a drop down so feel free to try all the different fields in contact form 7 enjoy them use this new knowledge that you've got expand on it and do some wonderful things and in the next video I'm going to do something with gravity forms so be on the lookout for that to see how you can get information from your gravity forms and send it to an API or any other place you want to do that if you enjoyed the video don't forget to give it a thumbs up share it with your friends or even subscribe to the channel for more interesting WordPress stuff otherwise enjoy whatever you're developing


The five issues of interest to the elections. One is that it will be very difficult to tell what kind of coalition there will be, it won't be the coalition that we think it is on Sunday night. Secondly, the SPD and the CDU are very far away from each other in the opinion polls and therefore there will be a lot of enmity if we do have a grand coalition. The CDU will not want to give ground to the SPD. The third thing is that the Hessian election taking place on the same day will be incredibly important to show the distribution of seats in the upper house, the state run Bundesrat, and that could have a big impact on what happens in Berlin as a whole. The fourth thing is that the Liberals will become incredibly aggressive if they do manage to get back into power. Nobody thinks that they will do, and also if the CDU, Mrs Merkel does go into opposition, if there is a left-wing coalition, the CDU will be very, very awkward to deal with in opposition. And the fifth thing is that I think Steinbuck, who's the leader, the chancellor candidate of the SPD, it's a great shame that almost certainly he will not be the chancellor in almost any constellation, he will go into retirement. I think it's a big loss for German politics. Mrs Merkel up to now has managed to survive, and she is a survivor, by obfuscating the key issues and enveloping her policies and her people with a layer of comfort that all will be well on the night.  She actually says, vote for me because you know me. I think it's going to get more difficult afterwards. I foresee that the last couple of years have been something of a golden age for Mrs Merkel economically. It's going to be much tougher. The European issues have not gone away. In many ways they've got more difficult. Big showdown between France and Germany, I think, the Greeks will need a substantial bail-out, and she won't be able to obfuscate. So when they say more of the same, no experiments, I expect that they won't be the same. It'll be tougher, it'll be sharper, and also she'll be weaker than she has been up to now. Ireland will have to stand on its own two feet, as it has been doing increasingly. It will have to try to wean itself away from European or official assistance. It will have to balance its books, as it is increasingly doing. I'm a bit worried about the Irish banks. If you don't have a thorough going recovery here, if house prices don't start to recover, there'll be more foreclosures. We haven't seen all the bad news for the Irish banks, and that will have an impact on the state as well. I don't think you can rely on Europe too much. I think Ireland has got to carry on in its very courageous and steadfast way of getting its own way out of trouble, not relying on the Europeans too much, because frankly, the Europeans will have a lot of other things to do, and Ireland can stay out of the headlines and carry on doing your own homework in a way that meets the needs of the private financial markets. You need to get back to the private financial markets as quickly as possible and not rely too much on Brussels.